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
    Jun 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Refresh IFrame without page refresh

    Hi All,

    I have included IFrames in my project . I want to refresh the content of IFrame

    when i click some button without refreshing the whole page....I cant figure it

    out...Anybody can help..?

  • #2
    Regular Coder Kristofa's Avatar
    Join Date
    Jun 2009
    Location
    Leicester
    Posts
    143
    Thanks
    7
    Thanked 20 Times in 20 Posts
    Hmm...I guess you could try using Javascript to replace the URL of the iframe with the same URL, that seems to refresh the page for me. :-)

    Put this in your <head> tag.

    Code:
    <script type="text/javascript">
    function refresh()
    {
    var x=document.getElementById("iframe").src;
    document.getElementById("iframe").src=x;
    }
    </script>
    Give your iframe the id 'iframe' and add this button somewhere on the page.

    Code:
    <button onclick="refresh()">Refresh</button>


  •  

    Posting Permissions

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