php - Jquery Countdown Server sync issue -


i'm trying create countdown event. i'm using jquery countdown

i have code:

$(function () {     var fecha = new date("july 30, 2011 00:00:00");     $('#defaultcountdown').countdown({         until: fecha,         format: 'dhms',         expiryurl: "http://www.google.com",         serversync: servertime,         timezone: -4     });   });   function servertime() {     var time = null;     $.ajax({         url: 'servertime.php',         async: false,         datatype: 'text',         success: function (text) {             time = new date(text);         },         error: function (http, message, exc) {             time = new date();         }     });     return time; } 

the script working fine, when try change clock date, countdown changes. idea why?

i imagine created servertime.php file on server? http://keith-wood.name/countdown.html tab timezones has php code you'll need add servertime.php script use that. may want qualify url: 'http:yourdomain.com/servertime.php' using should use server time not local pc time. if server on local pc, well... change.


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -