Random Image on page load problem
Hello all
I am having errors for some reason for the following script, can anyone help here?
What i want to do is randomize set images in the same location each time the same page is loaded by someone: It's driving me nuts !! The script is:
<head>
<script language="javascript">
function imgswp() {
var imgs = new Array("../Banners/0009.jpg","../Banners/0010.jpg","../Banners/0011.jpg","../Banners/0012.jpg")
document.getElementById("aimg").src = imgs[Math.floor(Math.random()*imgs.length)]
}
</script>
</head>
<body onLoad="imgswp()">
<div id="top2">
<h2>
<img border="0" img id="aimg" src="" width="430" height="85" >
</h2></div>
Last edited by stewb; 04-02-2005 at 01:51 PM..
|