首页  ·  知识 ·  云计算
Web中的页面刷新
网友     综合  编辑:dezai   图片来源:网络
Apple-style- color: rgb(51, 51, 51); font-family: verdana, ????, Arial; font-size: 14
 1.实现页面自动刷新

 

把如下代码加入到<head>区域

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

 

2.页面自动跳

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

指定隔5秒后跳转到指定的页面httt://www.baidu.com,如果是当前页面,则为自动刷新。

 

3.setTimeout()方法实现。

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

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

 

可以通过脚本实现:

<script language="javascript">

function chang()

{

document.location='http://ww.baidu.com';

}

setTimeout(chang,50000);    //定时执行

//setInterval(chang,5000);    //间隔执行

//setTimeout("document.location='http://www.baidu.com'",3000)

</script>

 

4.按钮刷新得N种方法

<input type=button value="刷新" onclick="history.to(0)">

<input type=button value="刷新" onclick="location.reload()">

<input type=button value="刷新" onclick="location=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)">

<intpu type=button value="刷新" onclick="window.open('http://www.baidu.com'),'_self')">

<input type=button value="刷新" onclick="window.all.WebBrowser.ExecWb(22,1)">

本文作者:网友 来源:网络
CIO之家 www.ciozj.com 微信公众号:imciow
   
免责声明:本站转载此文章旨在分享信息,不代表对其内容的完全认同。文章来源已尽可能注明,若涉及版权问题,请及时与我们联系,我们将积极配合处理。同时,我们无法对文章内容的真实性、准确性及完整性进行完全保证,对于因文章内容而产生的任何后果,本账号不承担法律责任。转载仅出于传播目的,读者应自行对内容进行核实与判断。请谨慎参考文章信息,一切责任由读者自行承担。
延伸阅读