1. 程式人生 > >頁面自動重新整理兩種方式

頁面自動重新整理兩種方式

1.在head中加入<meta http-equiv="refresh" content="10">指定10秒重新整理一次;


2.使用js

<script  type="text/javascript">

function refresh(){
window.location.reload();
}
setTimeout('refresh()',2000); //指定1秒重新整理一次

</script>


為了驗證重新整理了

我們在body中加入一段程式碼

<body onload="alert('我被載入了!')">