• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4692
  • Last Modified:

How to make a time counter in the webpage

I need to set a time counter. Then it may used for fixed time interval  refreshing webpage by AJAX.
0
turbot_yu
Asked:
turbot_yu
2 Solutions
 
TimYatesCommented:
http://www.geocities.com/mangokun/programming/javascript/control_setTimeout.htm

Like that?  (the javascript is in the HTML source of the page)

Tim
0
 
BatalfCommented:
Or you can use setInterval() which repeats it's self more than once

example:

setInterval('reloadPageByAjax()',60000);

which calls the function reloadPageByAjax() each minute.

setTimeout('reloadPageByAjax()',60000);

calls the function reloadPageByAjax() after 60 seconds, but then it doesn't call it again after 120, 180, 240 seconds etc.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now