Thread: Countdown Timer
View Single Post
  #2 (permalink)  
Old 10-06-05, 03:58 PM
TwoD TwoD is offline
Community VIP
 
Join Date: Sep 2003
Location: 404
Posts: 1,813
Thanks: 0
Thanked 0 Times in 0 Posts
To make this working to 100%, you need serverside code like PHP or ASP.
The reason is that Javascript runs clientside inside the browser.
Anything you want to keep alive even if the user goes offline, must be handled serverside, and it usually requires the user to log in so the server knows the current state for that specific user.

You could store the current value of the counter along with the date on browser exit, so that the script can check if there's already a counter running when initializing it. Then use the stored countdown value and the date to figure out the current value of the counter. However, if the user turns off cookies, or clears them, the counter will be reset back to the default value anyway.
__________________
[W3Schools - learn all about the standards.] [QuirksMode - Browser Quirks] [MS's Online Reference Docs] [DOM in Gecko.]
Please pay attention to stickys, announcements and forum rules, thank you.
Please also remember Code Wrappers and [SOLVED] Marking, this helps everyone.
Reply With Quote