javascript timer based on world clock?
hey guys, is it possible to fire a function (every second开发者_如何学Python or every 500ms) based on a global world clock or something? I need a simultaneous time on each computer that opens this script!
any idea how to solve this?
regards
You would need to get the world time with some server implementation.
Then you could either decrement it with some setTimeout
function with a time--
on the time,
or you could decrement it with some ajax
call back to the server which would get the exact time again (also with a setTimeout
or setInterval
timer)
精彩评论