Home Date and Time Refresh page Script Developer's View
<html>
<body>
<script>
/***********************************************
* Refresh page Script- (c) Dynamic Drive (http://www.dynamicdrive.com)
* Please keep this notice intact
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/
function refreshpage(interval, countdownel, totalel){
var countdownel = document.getElementById(countdownel)
var totalel = document.getElementById(totalel)
var timeleft = interval+1
var countdowntimer
function countdown(){
timeleft--
countdownel.innerHTML = timeleft
if (timeleft == 0){
clearTimeout(countdowntimer)
window.location.reload()
}
countdowntimer = setTimeout(function(){
countdown()
}, 1000)
}
countdown()
}
window.onload = function(){
refreshpage(60, "countdown") // refreshpage(duration_in_seconds,
id_of_element_to_show_result)
}
</script>
<div>Next <a href="javascript:window.location.reload()">refresh</a> in <b
id="countdown"></b> seconds</div>
</body>
</html>