Random HTML content on load


/ Published in: JavaScript
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <SCRIPT LANGUAGE="Javascript">
  2. function banner() { } ; b = new banner() ; n = 0
  3. b[n++]= "<IMG name=randimg SRC='images/video_stills/01.jpg' border='0' ALT=''>"
  4. b[n++]= "<IMG name=randimg SRC='images/video_stills/14.jpg' border='0' ALT=''>"
  5. b[n++]= "<IMG name=randimg SRC='images/video_stills/04.jpg' border='0' ALT=''>"
  6. b[n++]= "<IMG name=randimg SRC='images/video_stills/02.jpg' border='0' ALT=''>"
  7. b[n++]= "<IMG name=randimg SRC='images/video_stills/10.jpg' border='0' ALT=''>"
  8. b[n++]= "<IMG name=randimg SRC='images/video_stills/05.jpg' border='0' ALT=''>"
  9. i=Math.floor(Math.random() * n) ;
  10. document.write( b[i] )
  11. </SCRIPT>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.