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

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -