The Dev Community! friendly and inclusive
Get started (no password needed)
Or Sign in with:
Is there a way to pause a function's execution when a user leaves a page? eg if I have something like: setInterval(cleanGarbage, 3000); Is there a way to pause it when the user switches his/her tab to a different page, so the function doesn't keep r...