I work on some kind of website that places importance on being up-to-date. For that purpose, I need to refresh the page when the user switches from another tab to the tab with the website.
Is there a way to do this with JavaScript / jQuery? I know that location.reload();
is used to refresh a page, but I don't know how to tell JavaScript to do this when the tab becomes active again (and only once then).