title: Change iframe src after x seconds
body: <p>I'm new to java script and I'm trying to run a Java Script that will cycle through several websites every X seconds automatically. It should go through all the 4 sites and go back to the beginning. For some reason only some of the sites are not displaying. Only Ask.com and Dogpile is displaying. Here's my code below. Could someone help me. Thank you in advance. </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var frames = Array('http://www.google.com/', 15,
      'http://www.yahoo.com/', 37,
      'http://www.ask.com/', 12,
      'http://www.dogpile.com/', 14);
  var i = 0, len = frames.length;
  function ChangeSrc()
  {
    if (i &gt;= len) { i = 0; } // start over
    document.getElementById('frame').src = frames[i++];
    setTimeout('ChangeSrc()', (frames[i++]*1000));
  }
  window.onload = ChangeSrc;</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;iframe src="" name="frame" id="frame" width="100%" height="100%"&gt;&lt;/iframe&gt;</code></pre>
  </div>
  </div>
  </p>