Back to Scripts page
Click in the text area below, select all and copy to grab the script
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Random Images</title> <script language="Javascript" type="text/javascript"> <!-- Hide script from old browsers myPix1 = new Array("images/pathfinder.gif","images/surveyor.gif","images/surveyor98.gif") myPix2 = new Array("images/callisto.jpg","images/europa.jpg","images/io.jpg","images/ganymede.jpg") function choosePix() { if (document.images) { randomNum = Math.floor((Math.random() * myPix1.length)) document.myPicture1.src = myPix1[randomNum] randomNum = Math.floor((Math.random() * myPix2.length)) document.myPicture2.src = myPix2[randomNum] } } // End hiding script from old browsers --> </script> </head> <body bgcolor="#FFFFFF" onload="choosePix()"> <img src="images/spacer.gif" width="201" height="155" name="myPicture1" vspace="10" alt="some image" /><br /> <img src="images/spacer.gif" width="262" height="262" name="myPicture2" vspace="10" alt="some image" /> </body> </html>
Images:
(Some scripts do not have associated images)