refresh page once
I've got a webpage that has information that needs to be updated on the fly. A problem I've encountered is that when I leave and return it doesn't update the page unless I refresh it. So I've written a function that refreshes the page on start, the problem is it refreshes constantly. Any ideas?
PS: On another note the function I've written would seem to work with onClick events. Could I get to this to work when the back button is pushed?
To make it refresh given an interval, use setTimeout() to call your function with a specified delay:
To make it refresh once, you could try using cookies to store session data. E.g. cookie with 5 minute expiration time in it set onload. Also in onload checks for existance of cookie. If not found, set cookie and refresh.
setTimeout("document.location = document.location; document.refresh()", 2000);
Last edited by savvykms; 07-03-2013 at 07:01 PM.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)