Display Random Image or Quote
Friday March 6, 2009
JavaScript can update your page for visitors even when you are away from your computer.
If you have a number of images, quotes, links, ads or whatever and you want to choose one of them at random to display on your page then this simple script is what you need.
Display Random Image or Quote


What is code0, code1….?
Please explain.
Thanks
code0 is your first image tag or quote
code1 is your second image tag or quote
code99 is your 100th image tag or quote etc.
isnt that ridiculous, i mean it is ok if you have 10-15 picture, i think that would be more easy just to point to the folder with images, since i dont have all the time in the world to make thousands of ‘code_x’, and to think i have to update it every time i have to display new added pictures… its just basic of basics man!
As JavaScript has no file access whatsoever that isn’t an option if you do this with JavaScript. The better way to do it is with a server side scripting language which does have such access but not everyone is using hosting with a server side language available.