You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • Yes, I'm afraid I just copied and pasted - I didn't set up a button to check.

    Unknown Timeout usually occurs when you call clearTimeout on a timer that's already fired or been deleted.

    I think your problem is:

    if(timeout) clearTimeout(timeout);
    

    It should be:

    if(timeout) {
      clearTimeout(timeout);
      timeout = undefined;
    }
    

    because if it gets called twice the way it was before, it'll delete the timer that has previously been deleted.

About

Avatar for Gordon @Gordon started