View Full Version : Help with iframe refresh

01-28-2009, 06:29 AM
ok im looking for some code from someone that's familiar with iframes and javascript

it should look something like this when its done


Yahoo search ...... Click here to start refreshing
Google search ...... Click here to start refreshing
Youtube Video ..... Click here to start refreshing

when one clicks start refreshing it should change "Click here to start refreshing" to "Stop" which should stop the refreshing process if clicked.

and thats it basicly i dont want it to show yahoo search or any of them at all

hope this can be done im quite new at all this coding and it would help me out ALOT!

sorry if my example is up to par please let me know and i will try and explain

ps: it should refresh every 5 minutes
Thanks a lot

01-28-2009, 09:12 PM
this is what i have so far i need the start freshing button to change into a functionable stop button.

and if i was to add say google search under yahoo would i need to rerun the whole javascript im sure i dont have to but i dont know how to do it maybe someone can help me with that


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<h2>i need the Click here to start refreshing to change into a stop button</h2>
var arrURL=new Array("http://yahoo.com/");
var curIndex=0;
var timer=0;
var refreshRate=10; //seconds
function ChangeFrame()
var url=arrURL[curIndex];
window.open(url, "yahoo");
curIndex = ((curIndex+1)%arrURL.length);
timer = setTimeout("ChangeFrame()", refreshRate*1000);
Yahoo <iframe name="yahoo" id="Frame1" src=""http://yahoo.com/" width="0" height="0" border="0"></iframe>
<input type="button" onclick="ChangeFrame();" value="Click here to start refreshing" />
<br />