一直在Js學習路上,關于重新整理頁面也有很多内容要學習,這篇算是做筆記吧。重新整理頁面是經常遇到的問題,Js也有很多可以重新整理頁面的方法。
比如,在我找到的重新整理頁面的方法中,下面三個是比較快的。
window.location.reload();
window.history.go(0);
document.execCommand('Refresh');
還有一些可以讓頁面自動重新整理方法也記錄一下:
<meta http-equiv="refresh" content="1">//1秒重新整理一次頁面
<meta http-equiv="refresh" content="1;url=http://www.caohongyuan.cn">//1秒後跳轉到http://www.caohongyuan.cn頁面
也可以寫一下Js腳本:
<script>
setTimeout('window.location.reload()',1000); //1秒重新整理一次
</script>
歡迎指導!