I'm hoping someone can help... this random script doesn't always show the images when the page is refreshed... usually only one image will show, and the others come up with red x's. I don't understand what's wrong.

Here's the code:

<script language="javascript">

// add image URLs, separated by commas
var images = new Array('http://tinyurl.com/28s8x4', 'http://tinyurl.com/28kv9c', 'http://tinyurl.com/yocw49');

document.write('<img src = "' + images[Math.floor(Math.random()*images.length+1)] + '"border = "0" alt = "Cats rule!" />');

and here's a link to it on practicewriter:


Thanks, any help would be really appreciated.