Skip to content

Instantly share code, notes, and snippets.

@martync
Created April 18, 2013 08:13
Show Gist options
  • Save martync/5411068 to your computer and use it in GitHub Desktop.
Save martync/5411068 to your computer and use it in GitHub Desktop.
Ask the user to refresh the page after a countdown;
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