Page is a not externally linkable
- Code, Content, and Presentation
-- JavaScript and AJAX
---- stopping "chained" functions before they end


sssweb - 10:50 pm on Jan 21, 2013 (gmt 0)


I found one solution that works in some cases, but still not all:

var timer = null;

function myFunc(){
// code
timer = setTimeout("myFunc()", 1);
}

// run this on reset to stop the above function:
function stop(){
clearTimout(timer);
}

Any better ideas?


Thread source:: http://www.webmasterworld.com/javascript/4537712.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com