Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jan 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation Help with iframe refresh

    ok im looking for some code from someone that's familiar with iframes and javascript

    it should look something like this when its done

    <example>

    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
    Last edited by rcot504; 01-28-2009 at 06:45 AM.

  • #2
    New to the CF scene
    Join Date
    Jan 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

    <code>

    <!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">
    <head>
    <h2>i need the Click here to start refreshing to change into a stop button</h2>
    </head>
    <body>
    <script>
    var arrURL=new Array("http://yahoo.com/");
    var curIndex=0;
    var timer=0;
    var refreshRate=10; //seconds
    function ChangeFrame()
    {
    clearTimeout(timer);
    var url=arrURL[curIndex];
    window.open(url, "yahoo");
    curIndex = ((curIndex+1)%arrURL.length);
    timer = setTimeout("ChangeFrame()", refreshRate*1000);
    }
    </script>
    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 />
    </body>
    </html>

    </code>
    Last edited by rcot504; 01-28-2009 at 10:51 PM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •