I'm attempting to create a frame that loads a page with a specific variable based on a random number, but I can't seem to get it to work. Any help would be greatly appreciated.
Here's what I've got so far:
Any ideas where I'm going wrong?
Here's what I've got so far:
Code:
<html>
<head>
<title>Main Page</title>
</head>
<frameset rows="100%">
<script language='javascript'>
<!--
var sponsorid=new Array()
sponsorid[0]="main.html?id=sp1"
sponsorid[1]="main.html?id=sp2"
sponsorid[2]="main.html?id=sp3"
sponsorid[3]="main.html?id=sp4"
sponsorid[4]="main.html?id=sp5"
var frmSrc=sponsorid[Math.floor(Math.random()*sponsorid.length)]
document.write('<frame src="'+frmSrc+'" scrolling=auto frameborder="no" border=0 noresize>');//-->
</script>
<noframes>
<body>
<script language='javascript'>
window.location = "main.html?id=sp1";
</script>
</body>
</noframes>
</frameset>
</html>
Comment