javascript - Dynamic increasing counter -


i wondering "best" way of making counter in javascript or jquery respond data database? purpose should show amount of people taking part of surveys in different countries. guess need hook sán ajax request , maybe kind of long polling solution "listens" updates in database. pointers this?

regards!

the best way using comet, allows have "server events" pushed client (as facebook , many other sites do), it's relatively hard implement.

the cometd project

one easy way, using setinterval.

setinterval(function(){    $.ajax({      ...    }); }, 5000); 

hope helps


Comments