...

View Full Version : Reload Page ??onFocus??



jakerbug
10-02-2004, 10:02 PM
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?

jakerbug
10-02-2004, 11:18 PM
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!

jamescover
10-03-2004, 03:43 AM
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

stevenflo
11-02-2004, 06:51 AM
Please excuse my late reply. I have the same problem and have tried this in the main page for one link


onclick="javascript:window.location.reload();"
and this is the pop up of another link.

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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum