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 Coder
    Join Date
    Mar 2004
    Location
    New Jersey
    Posts
    70
    Thanks
    2
    Thanked 1 Time in 1 Post

    Reload Page ??onFocus??

    I have a page that contains some rollover graphics that are preloaded when the page initially loads. If a link is clicked on the page that opens in a new window (or any other browser window opens on top of mine) and then you go back to my page, the rollovers have the delay that you'd expect from the lack of a preload.

    I'm not sure why this happens, but i'd be happy simply having a script that reloads my page when it comes back into focus.

    I put "onFocus="window.location.reload()" in my body tag, but this constantly reloads the page, which is no good. I'm not sure if that happens because I have iframes, or if that's just what that event handler does...

    In any case, I'd think there would be a simple solution to this problem, but I can't figure out what it is. Am I on the wrong track thinking in terms of onFocus and onBlur? Does it seem that I don't understand their functions correctly?

  • #2
    New Coder
    Join Date
    Mar 2004
    Location
    New Jersey
    Posts
    70
    Thanks
    2
    Thanked 1 Time in 1 Post
    nevermind... i just put a onclick="javascript="window.location.reload()" in each of the anchor tags for links that open in new windows...

    if anyone knows why that happens though, i'd like to know. if the images are in cache, why do they not show up immediately after my window loses focus?

    thanks!

  • #3
    Regular Coder
    Join Date
    Aug 2002
    Location
    USA
    Posts
    625
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by jakerbug
    nevermind... i just put a onclick="javascript="window.location.reload()" in each of the anchor tags for links that open in new windows...

    if anyone knows why that happens though, i'd like to know. if the images are in cache, why do they not show up immediately after my window loses focus?

    thanks!

    Your problem sounds like typical IE bad behavior regarding cached images. However, you may want to check your own Internet settings (Tools > Internet Options > Settings), to ensure that "Every visit to the page" is checked.

    Not this:

    onclick="javascript="window.location.reload()"

    this:

    onclick="javascript:window.location.reload();" ...


    -james
    "God so loved the world that he gave his only begotten son, so that whosoever believed in him would not perish, but have everlasting life. For God did not send his son into the world to condemn the world, but so that through him the world might be saved. "

  • #4
    New to the CF scene
    Join Date
    Sep 2004
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Please excuse my late reply. I have the same problem and have tried this in the main page for one link
    Code:
    onclick="javascript:window.location.reload();"
    and this is the pop up of another link.
    Code:
     onUnLoad="window.opener.location.reload(1);
    Both work fine, but...why must we reload the ENTIRE page including the "off" images that are already visible? My page has about 12 thumbnails now, and growing. What happens when there are 50 or more? I can't imagine putting someone through the agony of waiting for over 100 images to reload every time they click on a thumbnail, especially those using dial-up. Forget about it. I could scrap the rollovers altogether, but what fun would that be?

    Is there a way to re-preload the "over" images only?
    Any other guesses as to why this is an issue with IE?
    Personally, I don't want to mess with my IE settings. I assume that most guests to my website wouldn't have a clue as to how to do this, and I want to make sure I experience it as they would.
    Last edited by stevenflo; 11-02-2004 at 08:34 AM.


  •  

    Posting Permissions

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