canceling settimout altogether

A

anagai

hi

I would like to cancel a settimout from happening. I dont want it to
execute the expression at all. clearTimeout just cancels the delay but
executes the expression anyway. I want to cancel the delay and the
function call. Is there a easy way to do this?

Andy Nagai
 
L

Lee

anagai said:
hi

I would like to cancel a settimout from happening. I dont want it to
execute the expression at all. clearTimeout just cancels the delay but
executes the expression anyway.

No it doesn't. Perhaps you're accidentally executing the expression
some other way?
 
T

Thomas 'PointedEars' Lahn

anagai said:
I would like to cancel a settimout from happening. I dont want it to
execute the expression at all. clearTimeout just cancels the delay but
executes the expression anyway. I want to cancel the delay and the
function call. Is there a easy way to do this?

What are you talking about? The first argument of window.setTimeout() is
evaluated (string value) or called (Function object reference) only on
timeout, and is not evaluated or called when the time is not up and you
call window.clearTimeout() with the proper timeout ID as argument.

Probably you call a function instead of providing a reference to it in
the first argument of window.setTimeout(); if so, just do not call it.


PointedEars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top