I've got a setInterval() called in a jQuery plugin, but I want to clear it from my main page, where I don't have access to the variable that the setInterval was stored in.
Is there a way to clear all timers present on a page?
I've got a setInterval() called in a jQuery plugin, but I want to clear it from my main page, where I don't have access to the variable that the setInterval was stored in.
Is there a way to clear all timers present on a page?
You can override setInterval:
window.oldSetInterval = window.setInterval;
window.setInterval = new function(func, interval) {
var interval = oldSetInterval(func, interval);
// store it in a array for stopping? stop it now? the power is yours.
}