1.頁面自動刷新:把如下代碼加入<head>區域中
<meta http-equiv="refresh" content="20">,其中20指每隔20秒刷新一次頁面.
2.頁面自動跳轉:把如下代碼加入<head>區域中
<meta http-equiv="refresh" content="20;url=http://www.hackhome.com">,其中20指隔20秒后跳轉到http://www.hackhome.com頁面
3.頁面自動刷新js版
<script language="JavaScript"> function myrefresh(){ window.location.reload(); } setTimeout('myrefresh()',1000); //指定1秒刷新一次 </script>
w3c 關於setTimeout()的使用介紹:
包含有無窮循環函數
http://www.w3school.com.cn/jsref/met_win_settimeout.asp
http://www.runoob.com/jsref/met-win-settimeout.html
setInterval(code,millisec[,"lang"]):設置循環執行
http://www.w3school.com.cn/jsref/met_win_setinterval.asp