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
    Dec 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Reload iframe content

    Hello,

    I want to refresh the content of html page and (at the same time) refresh the content of an iframe that is on that page. I want this all to happen just by clicking the refresh button in my browser navigation bar. How should I do it? I have been looking at Javascripts and <body onload...>scripts but I can't seem to find any script or code that does the trick.

    Here a bit more explanation:
    • I have an html page (page.html) with an iframe (iframe) in it.
    • In that iframe I show another html page (iframe1.html) that has an image with a hyperlink on it.
    • The hyperlink image refers to a third html page (iframe2.html).


    When I open the page.html in my browser for the first time, all goes well. I can see the picture and click on it. After clicking the hyperlink image the iframe shows the iframe2.html page, just like it should.

    However, when I refresh the page.html in my browser, the iframe keeps showing ifram2.html instead or returning to iframe1.html. What I would like to find is a script to reload the iframe content upon reloeading my page.html.

    I have been searching Google for hours to find a solution. I feel that what I am looking for shouldn't be very complex, but maybe I am just looking in all the wrong places? I very much hope that one of you can help me out! Thanks so much in advance!

    DoDo -

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Got link? It should load the first page that was in the iframe. Sounds like a caching issue on your end.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    New to the CF scene
    Join Date
    Dec 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi,

    It's a page on which I am experimenting a bit with publishing a video or audio file. Here's the link:
    www.ruter.nl/play_av.html.

    If it's a caching problem, won't more people have the same problem if they view my page? Is it possible to overrule this?

    Cheers,
    Dorine

  • #4
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Server-side would be the easiest way of dealing with this - prevent those pages from being cached as you serve them.

    But if that's not possible, try a function tied to the load event of the parent page, that sets the SRC of the iframe page, but with the addition of a random number in query-string data appended to the address. That random number will ensure the URL is always unique, and hence, you never get a cached response.
    "Why bother with accessibility? ... Because deep down you know that the web is attractive to people who aren't exactly like you." - Joe Clark


  •  

    Posting Permissions

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