Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
A pure JS redirect with configurable URL and delay.
<script type="text/javascript">
// delay, in milliseconds
var delay = 6000;
var URL = "";
document.write("<h1>This page has moved. You will be redirected in " + delay/1000 + " seconds. If you are not redirected, please <a href=" + URL + ">follow this link</a>.</h1>");
setTimeout(function(){ window.location = URL; }, delay);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.