do you guys have any idea why can't this clear interval? i need this to be clean when ajax complete.
var startTimer = function(){
setInterval(countdown, 1000);
}
var stopTimer = function(){
clearInterval(countdown);
}
var countdown = function(){
console.log('listening');
}
$(document).ajaxComplete(function(event, xhr, settings) {
if (settings.url.split('?')[1] == undefined)
stopTimer();
else
startTimer();
});