Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Aug 2004
    Location
    codegoboom@yahoo.com
    Posts
    999
    Thanks
    0
    Thanked 0 Times in 0 Posts

    clearTimeout spec.

    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?
    *this message will self destruct in n-seconds*

  • #2
    Smokes a Lot
    Join Date
    Jul 2003
    Location
    CA, USA
    Posts
    1,594
    Thanks
    5
    Thanked 20 Times in 20 Posts
    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
    Helping to build a bigger box. - Adam Matthews

  • #3
    Regular Coder
    Join Date
    Aug 2004
    Location
    codegoboom@yahoo.com
    Posts
    999
    Thanks
    0
    Thanked 0 Times in 0 Posts
    It would make more sense if an error was thrown, but yeah, it must be handled by the method...
    *this message will self destruct in n-seconds*


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •