Full version: jsB@nk » Browser » Window » Automatic Page Refresher with or without Countdown Display
URL: https://www.javascriptbank.com/automatic-page-refresher.html
This JavaScript automatically refreshes (reloads) your webpage every few seconds and displays the countdown-time inside the status bar. Easy configuration of the refresh interval. The coundown-display can be turned on or turned off. Copy-and-paste installation.
Full version: jsB@nk » Browser » Window » Automatic Page Refresher with or without Countdown Display
URL: https://www.javascriptbank.com/automatic-page-refresher.html
<SCRIPT language=JavaScript>// Automatic Page Refresher// Author: Peter Gehrig // Web Site: http://www.24fun.com ////////////////////////////////////////////////////////////////////////////// CONFIGURATION STARTS HERE// Configure refresh interval (in seconds)var refreshinterval=5// Shall the coundown be displayed inside your status bar? Say "yes" or "no" below:var displaycountdown="yes"// CONFIGURATION ENDS HERE////////////////////////////////////////////////////////////////////////////// Do not edit the code belowvar starttimevar nowtimevar reloadseconds=0var secondssinceloaded=0function starttime() {starttime=new Date()starttime=starttime.getTime() countdown()}function countdown() {nowtime= new Date()nowtime=nowtime.getTime()secondssinceloaded=(nowtime-starttime)/1000reloadseconds=Math.round(refreshinterval-secondssinceloaded)if (refreshinterval>=secondssinceloaded) { var timer=setTimeout("countdown()",1000)if (displaycountdown=="yes") {window.status="Page refreshing in "+reloadseconds+ " seconds"} } else { clearTimeout(timer)window.location.reload(true) } }window.onload=starttime</SCRIPT><!-- This script downloaded from www.JavaScriptBank.com Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->