title: Random Iframe in JavaScript
body: <p>I would Correct Next script paragraph Stay Way I Need.</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;script&gt;
  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]);
  
  }
  
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body onload="randomIframe(publicidade)"&gt;
  
  &lt;iframe name="publicidade" width="500" height="100"&gt;&lt;/iframe&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I was wondering if you have some form of <code>&lt;iframe&gt;</code> stay within the same script, not below the body which <code>document.write</code> use within the script and <code>window.onload = random_iframe</code> for example. To stay just something inside of <code>&lt;script&gt;</code> to <code>&lt;/script&gt;</code>.</p>