I have a div that loads a counter for things such as how many posts .etc, I want this to update automatically. Currently I am using:
function count() {
$('#refresh-me').load('stats_counter.php?table=projects');
}
var auto_refresh = setInterval(function () {
count()
}, <?php echo _REFRESH_INTERVAL; ?>);
count();
Users can add/publish events, and I want this counter to update. I think I need to trigger a callback everytime the user publishes or adds events to update this counter. I am aware things such as http://amplifyjs.com/ exist, but I am wondering what is the most intuitive and "easy" way of doing this.