I have read various sources here and have created the following ways to redirect a user after 10 seconds. Not employed at the same time.
First attempt in PHP:
header("refresh:10;url=?switch=1")
Then, second attempt in JavaScript:
window.setTimeout(function () {
location.href = '?switch=1';
}, 10000);
They both work nearly all of the time. They are used on a page using reveal.js (like this one). Sometimes when the URL fragments change, the page no longer redirects at all - though, more often than not, the redirection does indeed work.
Can anyone let me know what the issue might be, or a good resource to read about the issue?
Edit: Changing to setInterval
in the JavaScript version results in it trying again.
<meta http-equiv="refresh" content="10; url=?switch=1">
meta. – PlanulaURL fragments change
? provide example – Wallford