wuweiblog

刷新页面的方法

1.实现页面自动刷新

把如下加入到<head>区域中:

<meta http-equiv = "refresh" content = "5">

其中"5"指每隔5秒刷新一次页面。

2.页面自动跳转

<meta http-equiv = "refresh" content = "5;url = " _mce_href="http://www.maticsoft.com">">http://www.maticsoft.com">

指隔5秒后跳转到http://Maticsoft.com页面,如果是当前页面即为自动刷新了。

3.setTimeout实现

<body onload = "setTimeout(\'history.go()\',5000)">

<body onload = "setTimeout(\'this.location.reload();\',5000)">

也可以通过脚本实现:

<script type = "text/javascript" language = "javascript">
     function chang()
{
 document.location = \'http://www.maticsoft.com\';
}
setTimeout(chang,5000);//定时执行
//setInterval(chang,5000); //间隔执行
//setTimeout("document.location = \'http://www.maticsoft.com\' ",3000)
</script>

4.按钮刷新的N种方法

<input type = button value = 刷新 onclick = "history.go(0)">
<input type = button value = 刷新 onclick = "location.reload()">
<input type = button value = 刷新 onclick = "location = location">
<input type = button value = 刷新 onclick = "location.assign(location)">
<input type = button value = 刷新 onclick = "document.execCommand(\'Refresh\')">
<input type = button value = 刷新 onclick = "window.navigate(location)">
<input type = button value = 刷新 onclick = "location.replace(location)">
<input type = button value = 刷新 onclick = "window.open(\'http://www.maticsoft.com\',\'_self\')">
<input type = button value = 刷新 onclick = "document.all.WebBrowser.ExecWB(22,1)">

分类:

技术点:

相关文章:

  • 2021-11-13
  • 2021-12-13
  • 2021-12-23
  • 2021-12-15
  • 2021-12-23
  • 2021-12-18
  • 2021-12-10
  • 2021-08-30
猜你喜欢
  • 2021-11-03
  • 2021-08-30
  • 2021-12-13
  • 2021-12-15
  • 2021-12-23
  • 2021-12-23
  • 2021-12-05
相关资源
相似解决方案