Results 1 to 3 of 3

Thread: refresh page once

  1. #1
    Join Date
    Mar 2013

    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?

  2. #2
    Join Date
    Mar 2013

  3. #3
    Join Date
    Oct 2007
    Western Massachusetts, USA
    To make it refresh given an interval, use setTimeout() to call your function with a specified delay:
    PHP Code:
    setTimeout("document.location = document.location; document.refresh()"2000); 
    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.
    Last edited by savvykms; 07-03-2013 at 07:01 PM.
    Computer programmer / web developer.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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