Topic: How can I stop a settimeout?

Hi,
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
L.

Re: How can I stop a settimeout?

Hi,

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():

http://www.techotopia.com/index.php/JavaScript_Timeouts

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