javascript - Do I need to clear timeouts if user leaves? -
my website uses timeouts , delays animations. need clear these if user leaves page without these timers finishing? unsafe @ not so?
i.e. (exaggerating little) if have settimeout(func, 10000000) , user leaves in few seconds.
the short answer, pointed on responses, no
, not need clear timeouts before user leaves.
if you're working single page application (spa)
if app spa, browser doesn't reload, timers still called, though page has "changed". thus, unless want timer shared across pages, you'd want clear them on page change.
Comments
Post a Comment