….bind("focus", function(event){
// […]
var intervalStoryAlerts = setInterval(loadStoryAlerts, 6000);
var intervalMessageAlerts = setInterval(loadMessageAlerts, 16000);
})
Those var
declarations make these two variables local to the function, and your code will not overwrite the variables in the ready-handler's scope. Therefore, the values will be lost and the intervals are not cleared. Just omit "var
".