Answer the question
In order to leave comments, you need to log in
How to implement a timer on the site?
In web development, I recently and have not yet mastered the entire technical side of the issue of implementing web applications, so I would like to know the options for implementing the plan. The bottom line is this: there is a website, you need a timer that would give you the opportunity to freely use the site, navigate through pages, etc., while working somewhere in parallel and showing how much time is left. At the expiration of the term - would cause a php script. At the same time, so that it could be stopped if necessary earlier. I will be grateful.
Answer the question
In order to leave comments, you need to log in
Almost all JavaScript implementations have an internal scheduler that allows you to schedule a function to be called after a given period of time. setTimeout function.
Time in JS will be local (client, browser) by default.
>All the methods above return the result for the local time zone.
Translation to GMT - using the getTimezoneOffset() method.
Arithmetic calculate how much is left.
"On expiration" - watch through setTimeout or setInterval.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question