About This Script
Sometimes you have a page with content that needs to continually be updated. This is an easy way to refresh the page every few seconds so the visitor will always see the latest content. Paste the code anywhere on the page you want to automatically refresh.
Demo
Code
<p id="refreshCountdown"></p>
<script>
// Auto Refresh provided by http://www.top-site-list.com
var refreshIn = 10;
function refreshTick() {
--refreshIn;
if (refreshIn <= 0) {
window.location.reload();
}
document.getElementById('refreshCountdown').innerHTML = str = 'This page will refresh in ' + refreshIn + ' second' + (refreshIn > 1 ? 's' : '');
}
setInterval(refreshTick, 1000);
refreshTick();
</script>
More scripts