Results 1 to 2 of 2

Thread: Iframe refresh does not work in my webpage

  1. #1
    Join Date
    Jan 2012
    Posts
    25
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Iframe refresh does not work in my webpage

    Hello!
    Well, exactly in this forum i found (at last!) the iframe refresh code that i was searching for:

    <script type=text/javascript>
    function refresh()
    {
    document.all.a3c0f84d.src = document.all.a3c0f84d.src;
    }
    window.setInterval("refresh()",10000);
    </script>
    Of course, the id of my Iframe is "a3c0f84d".
    I succefully used this code in: http://codigoindex.es.tl/ just to see that it works.
    But in my other webpage, i have 3 of these iframes with same id and they never reload, despite i put the javascript code in head or body, but nothing happens.

    Can someone help me with this? Thanks a lot.

  2. #2
    Join Date
    Sep 2007
    Location
    The Netherlands
    Posts
    1,881
    Thanks
    49
    Thanked 266 Times in 258 Posts
    Blog Entries
    56

    Default

    Your code is outdated. Use:
    document.getElementById('a3c0f84d').src = document.getElementById('a3c0f84d').src

    You should not use one and the same ID for more than one element. So each of the iframes should have its own ID.
    ===
    Arie Molendijk.

Bookmarks

Posting Permissions

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