Please login or register. Welcome to the Studio, guest!


Quick Links:


newBookmarkLockedFalling

Moose

Moose Avatar

****
Senior Member

449


August 2005
I don't know of another way to refresh than how I did this function or through meta tags. Anyway I made a simple little function to handle page refreshing when scripting.

The function:
function refresh(time){
if(time){
time = parseInt(time);
setTimeout("location.href = location.href",time);
} else {
location.href = location.href;
}}


refresh() can take one parameter or none. The parameter is the number of milliseconds the script should wait before committing to the function. If you don't express a parameter then it will refresh right away.

So to recap I want to refresh right away:

refresh();

I want to refresh after 50 milliseconds:

refresh(50);

Hope that helps. :P

Greg says:
Coding music...
Greg says:
Hmm...
Greg says:
I wouldn't rule it out. :P
Chris 3.0 [New features? Yes.] says:
:P
Greg says:
If you think about machine code it's a bunch of 1s and 0s
Chris 3.0 [New features? Yes.] says:
Anything is possible.
Greg says:
Yeah try to code Metallica
Chris 3.0 [New features? Yes.] says:
:P Yeah, I'll get right on that... right after I learn to fly.

Chris

Chris Avatar

******
Head Coder

19,519


June 2005
location.reload(); <3 :P

But other then that, your idea is very helpful. But I've read some browsers don't support it, so infact, the best method, is to use something like this.


if(location.reload){
location.reload();
} else {
location.href = location.href;
}

Or something to that effect.

Also, maybe provide an optional parent, so you can refresh specific frames, popups, etc.

newBookmarkLockedFalling