Skip to content

Instantly share code, notes, and snippets.

@supercleanse
Created June 3, 2013 22:16
Show Gist options
  • Select an option

  • Save supercleanse/5701956 to your computer and use it in GitHub Desktop.

Select an option

Save supercleanse/5701956 to your computer and use it in GitHub Desktop.
Placing this script on the page will wait {delay_seconds} after the page is loaded and then will redirect to {redirect_url} ...
<script type="text/javascript">
$(document).ready(function() {
var redirect_url = 'http://example.com/cool';
var delay_seconds = 3;
setTimeout( function() {
window.location=redirect_url;
}, (delay_seconds * 1000) );
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment