Created
April 18, 2013 08:13
-
-
Save martync/5411068 to your computer and use it in GitHub Desktop.
Ask the user to refresh the page after a countdown;
This file contains hidden or 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
function refresh_after(seconds){ | |
seconds--; | |
if (seconds<=0){ | |
alert('The page has expired, click OK to reload.') | |
document.location.href = document.location.href; | |
}else{ | |
setTimeout(refresh_after, 1000, [seconds]) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment