WEB頁面自動刷新的實現

http://blog.csdn.net/liuruiqun/article/details/50466176


方法一:html

<title>xxxxx</title>之後加入下面這一行即可!
  1. <meta http-equiv="refresh" content="10">  


10代表刷新間隔,單位爲秒,實現每隔10秒對本頁面進行一次刷新

若是要定時跳轉到其他頁面,可以用

  1. <meta http-equiv="refresh"content="10;url=跳轉的頁面">  

方法二:javascript

使用

[javascript] view plain copy
  1. <script language="javascript">  
  2. setTimeout("self.location.reload();",1000);  
  3. <script>  

實現本頁面自動刷新,每秒一次

若是要跳轉到其他頁面,則可以使用

[javascript] view plain copy
  1. <script>setTimeout("location.href='url'",1000)</script>  
其中url是要刷新的頁面URL地址,等待時間爲1秒
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章