1
I would like to correct the following script to stay the way I need.
<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’s any way <iframe>
stay within oneself script, not below the <body>
, something that uses document.write
within the script and a window.onload = random_iframe
for example. To stay only something inside the <script>
up to the </script>
.
Great solution, however the sites are not opening within iframe, the entire page is redirected... Also, is it possible to leave iframe inside the first script with "Document.write"? For example Document.write('<iframe name="publicid....) Thank you
– Hugo Leonardo
edited, saved in an html and forehead, remembering that are 2 pages one that will load everything and another that contains the iframe with the desired resolution.
– Gabriel Rodrigues