At some point in my program I want to stop running any JS functions or/and timeouts/timeintervals… Can I stop processing probably untill user presses ‘reload’ button? function or idea of code?
I suppose you could use confirm() to force a reload. <i> </i>function die() { if (confirm("I just can't go on any longer!")) {window.history.go(0);} else {die();} }
@gil_davisNov 09.2006 — #To use clear functions I should know all intervals/timeouts.[/quote] That is correct. If your intent is to stop a timer, then it should be equated to a var when it is started so you can use clearTimeout/Interval functions. If there are alot of separate timers, you could use an array to hold them and step through the array to stop them. What do you mean 'nothing global'?[/quote] Literally, there is nothing to stop any running timer. You have to stop each one specifically.
@mjdamatoNov 09.2006 — #You could set a global variable, such as "runJS", and set it's value to true at the beginning of the page. Then make sure all functions have the first line:
if (runJS) {
You should be able to stop all functions from running by setting the value to false. It's a hack, but might work in your situation.