Forum Moderators: open
[in header]
<script language="JavaScript1.2" src='/image.js'></script>
[in body]
<script language="JavaScript1.2">
RandomImage();
</script>
[in image.js]
image_list = [001,002,003];
image_num = Math.floor(Math.random() * image_list.length() );
function RandomImage() {
document.write('<img width=400 height=218 src=" + image_list[image_num] + ".jpg>');
}
Your image.js should look like this...
<!--
image_list = new Array('001','002','003');
image_num = Math.floor(Math.random()*image_list.length);
//-->
...and the body like this...
<body>
<script type="text/javascript">
<!--
document.write('<img width=400 height=218 src='+image_list[image_num] + '.jpg>');
//-->
</script>
</body.
birdbrain
No problem, you're welcome.
birdbrain