»
Tiếng AnhTiếng PhápTiếng Việt

In - Tự động tải lại trang web - JavaScriptBank.com

Phiên bản đầy đủ: jsB@nk » Trình duyệt » Cửa sổ » Tự động tải lại trang web
URL: https://www.javascriptbank.com/automatic-page-refresher.html

Tự động tải lại trang web © JavaScriptBank.comHiệu ứng JavaScript này làm cho trang web tự động tải lại sau khoảng thời gian nào đó mà ta qui định, thời gian định kì này được hiển thị ở dưới thanh trạng thái.

Phiên bản đầy đủ: jsB@nk » Trình duyệt » Cửa sổ » Tự động tải lại trang web
URL: https://www.javascriptbank.com/automatic-page-refresher.html



JavaScript
<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-->