Jquery countdown plugin, how to synchronize to server time? -
Jquery countdown plugin, how to synchronize to server time? -
i want have countdown until 22:00 (10:00 pm) on server.
i couldn't understand documentary should exact way so, i've managed define time pulled server (though in fiddle doesn't work, maybe refuses grab servertime.php),
and define 22 hr value, doesn't work, adds +22 hours current time.
how should done?
do need code, , external php (that comes 2 additional .js resoruces) accomplish want?
html:
<span id="vvv"></span>
js:
$('#vvv').countdown({ until:new date(2014, 11 - 1, 9, 22, 0, 0), serversync: servertime, layout: '{hn} {hl}, {mn} {ml}, {sn} {sl}'} ); function servertime() { var time = null; $.ajax({url: 'http://keith-wood.name/servertime.php', async: false, datatype: 'text', success: function(text) { time = new date(text); }, error: function(http, message, exc) { time = new date(); }}); homecoming time; }
jquery jquery-countdown
Comments
Post a Comment