web页面刷新

论坛 期权论坛 编程之家     
选择匿名的用户   2021-6-2 20:35   1105   0

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 οnlοad="setTimeout('history.go(0),5000')">

<body οnlοad="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="刷新" οnclick="history.to(0)">

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

<input type=button value="刷新" οnclick="location=location">

<input type=button value="刷新" οnclick="document.execCommand('Refresh')">

<input type=button value="刷新" οnclick="window.navigate(location)">

<input type=button value="刷新" οnclick="location.replace(location)">

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

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

分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:3875789
帖子:775174
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP