web页面刷新

 

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
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值