...

View Full Version : clearTimeout spec.



codegoboom
12-18-2004, 08:59 PM
Syntax

window.clearTimeout(iTimeoutID)
Parameters

iTimeoutID Required. Integer that specifies the time-out setting returned by a previous call to the setTimeout method.
MSDN...


iTimeoutID is supposedly required, but if I go: clearTimeout(undefined);, or clearTimeout("foo");, or anything, no error occurs... so there's no practical reason to validate iTimeoutID, before supplying it, then, right?

Basscyst
12-18-2004, 10:42 PM
Are you asking if you should check if the timeout exists prior to clearing it? I haven't ever worried about it, and I would imagine that it would be fine, since a timeout clears itself eventually, it just makes sense.

Basscyst

codegoboom
12-18-2004, 11:04 PM
It would make more sense if an error was thrown, but yeah, it must be handled by the method... :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum