js break out of setinterval code example
Example 1: setinterval break
var refreshIntervalId = setInterval(fname, 10000);
/* later */
clearInterval(refreshIntervalId);
Example 2: how to break out of setinterval
var timerId = setInterval(function(){
if(window.document.drops.isFinished()){
clearInterval(timerId);
}
},1000);