SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast
    Join Date
    May 2009
    Posts
    41
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    iframe only refresh

    I have a webpage that has an iframe in it(actually several iframes). I use z-index to place the iframes on top of one another. when the user refreshes a page(either by pressing F5 or by clicking on the refresh button) I only want the top most iframe to be refreshed, I dont want the entire page to be refreshed or any of the other iframes to be refresed. Only the topmost iframe should be refreshed. Can anyone please help me achieve this.

  2. #2
    SitePoint Member robbin.joe's Avatar
    Join Date
    Oct 2009
    Location
    Beijing, China
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    try to check out the event "onbeforeunload", hope it will help.
    In actually, i didn't do this.

    Another way is to add a refresh button for each iframe div layer.

  3. #3
    SitePoint Enthusiast
    Join Date
    May 2009
    Posts
    41
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you very much for replying. Unfortunately "onbeforeunload" will not quite work for me for the following reasongs
    1) It will be executed every the time the page is being unloaded (for eg when the page is closed)
    2) The "onbeforenuload" does not actually stop the refreshing of the page. I can use it to call a function that will refresh the iframe but after doing that it will still continue with the page refresh.

  4. #4
    SitePoint Member robbin.joe's Avatar
    Join Date
    Oct 2009
    Location
    Beijing, China
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, either I am not sure "onbeforeunload" is suitable for your situation.

    What i suggest is add a refresh button, since javascript can't control many events totally, such as "F5".

  5. #5
    SitePoint Enthusiast
    Join Date
    May 2009
    Posts
    41
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks again for the suggestion robbin. But that is the last resort we want to use


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
  •