Created
September 6, 2017 20:36
-
-
Save jamesnotjim/d0f3f772631970d6fac848daa0936b1a to your computer and use it in GitHub Desktop.
A pure JS redirect with configurable URL and delay.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
// delay, in milliseconds | |
var delay = 6000; | |
var URL = "https://example.com"; | |
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); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment