Topic: How can I stop a settimeout?

I've a script refreshed called in this way:

$objResponse->script('setTimeout("xajax_myscript()", 35000);');

When I launch another script I wanna stop this one, how can I do this?

Thank you

Re: How can I stop a settimeout?


Javascript has a clearTimeout() function but it needs the id from setTimeout.

Your code might be:

$objResponse->script('var timeid = setTimeout("xajax_myscript()", 35000);');

See this page for cancelTimeout():

If you ever stop learning you may as well dig a hole, crawl in and pull the top over yourself.