I would like to fix the following script to stay the way I need it.
<html>
<head>
<script>
function randomIframe(obj){
var ends = new Array();
ends[0] = "http://www.terra.com.br";
ends[1] = "http://www.uol.com.br";
ends[2] = "http://www.bol.com.br";
ends[3] = "http://www.cade.com.br";
ends[4] = "http://www.baixaki.com.br";
var i = Math.round(Math.random()*ends.length-1);
obj.location.replace(ends[i]);
}
</script>
</head>
<body onload="randomIframe(publicidade)">
<iframe name="publicidade" width="500" height="100"></iframe>
</body>
</html>
I was wondering if there is some way for <iframe>
to be inside the script , not below <body>
, something that uses document.write
inside script and window.onload = random_iframe
for example. To get only something inside <script>
to </script>
.