Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Timers

Status
Not open for further replies.

bmdev

Programmer
May 13, 2003
29
US
Hello,

I want to use a timer to show some different images on a page. When the user closes the page will the timers go away or be left hanging out there?

When the page creates the timer, does the page use a timer on the server or on the client?

Thanks!!
 
The javascript is in the client and not on the server. When the page goes away, so does the timer.

There's always a better way. The fun is trying to find it!
 

If you are talking about timers that are created with the setTimeout or setInterval commands, then:

- The timers will go away when the page is unloaded, and
- The timers are run purely client-side. There is no server-side interaction at all.

Hope this helps,
Dan
 
If your code is
Code:
var timer = setTimeout("do_something()",x)

Then, just save "timer" in a cookie and read that cookie whenever you come back to the page.

Sincerely,

Tom Anderson
Order amid Chaos, Inc.
 

>> just save "timer" in a cookie and read that cookie whenever you come back to the page.

Tom,

This would do no good, as the timer is destroyed when the page is unloaded... Referring to an old handle will only cause errors.

Dan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top