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.
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 >= len) { i = 0; } // start over
document.getElementById('frame').src = frames[i++];
setTimeout('ChangeSrc()', (frames[i++]*1000));
}
window.onload = ChangeSrc;
<iframe src="" name="frame" id="frame" width="100%" height="100%"></iframe>