N
N
Nikolay Firsov2015-10-11 20:05:33
PHP
Nikolay Firsov, 2015-10-11 20:05:33

How to make a time left counter with time from the server?

Does anyone have an example of the remaining time counter, which works in real time on the page, but which time takes from the server? JS, as I understand it, cannot do this, but with PHP the counter will be static.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ivanq, 2015-10-11
@Ivanq

You can request data every second with ajax, but this is a big nonsense. I would get the time from the server from the very beginning, and then subtract one every second using pure JS

S
Sergey Zhukov, 2015-10-11
@Adobe

There is no need for AJAX at all. You take the starting countdown time from the server and that's it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question