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 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Nov 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation iframe link auto refresh

    hellow, will i started a project taht required me to ahve a page setup like this.

    first i have a few link on the page, i want those links to be clicked on with js and opened in an iframe and then do it all over again with a set timer

    anyone know how to get this going?

  • #2
    ess
    ess is offline
    Regular Coder
    Join Date
    Oct 2006
    Location
    United Kingdom
    Posts
    866
    Thanks
    7
    Thanked 30 Times in 29 Posts
    Hi seesoe.

    There is more than one to achieve this. the following is one way to do this.

    1- create a function in JavaScritp.

    function populateFrame( id, contents)
    {
    // note id, represents the iframe's id.
    // note contents, repsents the new contents.
    var my_iframe = window.document.getElementById( id );
    my_iframe.src = contents;
    }

    2- create another function with the timer, and have it call the first function.

    function timer_func( time_in_sec )
    {
    setTimeout( "populateFrame('id_value', 'contents_value' )", time_in_sec );
    }

    good luck.

  • #3
    New to the CF scene
    Join Date
    Nov 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    hhhmmm for some reason im still haveing trouble getting this.
    would it be possible if you can make a small html, that will do the following; then i will look at code and modify after i see how its supose to be.

    cuz this is an example, can you make a simple page with 4 iframes
    the iframe links can be anything, like
    google.com
    msn.com
    yahoo.com
    ask.com

    then on of page there could be 4 hyperlinks
    google *to google page*
    msn *to msn page*
    yahoo *to yahoo page*
    ask *to ask page*

    so now the page is setup,
    the buttons will use javascript to auto click on one of the 4 links and then load the result in one of the iframes

    sorry if i seem damanding but i couldn't figure it out

  • #4
    New to the CF scene
    Join Date
    Nov 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    bump.


  •  

    Posting Permissions

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