I read various sources here and created the following ways to redirect the user in 10 seconds. Not used at the same time.
First try in PHP:
header("refresh:10;url=?switch=1")
Then the second attempt in JavaScript:
window.setTimeout(function () { location.href = '?switch=1'; }, 10000);
They work almost all the time. They are used on the page using opens.js ( like this one ). Sometimes, when URL fragments change, the page is no longer redirected at all, although redirection most often does work.
Can someone tell me what could be the problem, or a good resource to read about the problem?
Edit: Switching to setInterval in the JavaScript version will re-awaken.
source share