View Full Version : Automatically reloading ONCE

03-11-2006, 08:39 PM
Alright, I know that javascript:history.go(0) will reload the page, but how can i do it automatically when the page is loaded? I need it to refresh all the images on the particular site. I tried throwing it in the onLoad thingy but it started a continuous loop of refreshing. Any ideas? Thanks

03-11-2006, 08:49 PM
Presuming you're not using any GET variables...
<body onload="if(window.location.href.indexOf('?autoRefresh') == -1) window.location.href = window.location.href + '?autoRefresh';">

03-12-2006, 10:15 PM
hmm... doesn't give me any errors but its not refreshing the page. any other ideas? thanks =)

03-12-2006, 11:33 PM
Works for me, maybe it is happening so fast, that you don't realize it. Does the address bar end up showing the query string:


at the end of the address? If so it is working. One thing I've noticed though is, that if your page looks funny until it is manually refreshed, usually no amount of auto refreshing will help that. If this is the problem, redesign your page so that it looks right the first time. Even if that isn't the problem, your page should look right the first time, gives us the particulars and a link to the page and we can probably find a way.

03-13-2006, 01:43 AM
well the only problem i'm running into is when I update a picture with an asp applet, it doesn't refresh the image. You have to manually refresh the page to get the image to refresh, because it's still reading it from the cache i guess. I've tried the whole response time = to 0 and all that jazz. Can't figure this out!

03-13-2006, 05:01 AM
I seem to recall something like that before, on two occasions. I don't think it was asp but another server side language. You'll forgive me because I am weak on all server side languages. I was able to resolve the problem with quite a bit of help from the folks who were having the trouble. The basic concept used was to:

a) Use a different filename each time for the new image.

b) Query the server periodically (this is where I needed help) to determine when the new file was actually ready.

c) Once it was determined that the file was ready, stop the query loop and, either refresh the page with the new filename or, change the image element's source to the new file using javascript.

It's been awhile. I may not have remembered it all exactly. Any of this seem feasible to you?

03-13-2006, 07:36 AM
An ASP applet? :-\

03-13-2006, 12:31 PM
woooops! I meant a javascript applet iconfigured to an asp page. sorry!

03-13-2006, 04:12 PM
I suspect you mean a Java applet.
See the sig. :)

03-13-2006, 04:33 PM
i'm having trouble expressing my thoughts lately... thank you twey, for correcting me. I know what i meant to say but it just fails to come out the right way.

03-18-2006, 02:58 PM
anyone else with suggestions?

03-18-2006, 03:02 PM
How about a link to the page?

03-20-2006, 04:57 PM
well you see, in order to get to the page, you need to log in, fill out a 53 question profile builder, and upload a photo. I know you guys don't want to do that. I'll try to set up a version that doesn't make you login tonight.