js页面刷新事件 ,Javascript刷新页面的几种方法

1)
<meta http-equiv="refresh"content="10;url=跳转的页面">
10表示间隔10秒刷新一次
 
2)
<script language=''javascript''>
<a target=_blank target="_blank" class="inner-link decor-none" href="http://zhidao.baidu.com/search?word=window.location&fr=qb_search_exp&ie=utf8" rel="nofollow" style="color: rgb(45, 100, 179); text-decoration: none;">window.location</a>.reload(true);
</script>
如果是你要刷新某一个iframe就把window给换成frame的名字或ID号
 
3)
<script language=''javascript''>
window.navigate("本页面url");
</script>
 
4>
function abc()
{
<a target=_blank target="_blank" class="inner-link decor-none" href="http://zhidao.baidu.com/search?word=window.location&fr=qb_search_exp&ie=utf8" rel="nofollow" style="color: rgb(45, 100, 179); text-decoration: none;">window.location</a>.href="/blog/<a target=_blank target="_blank" class="inner-link decor-none" href="http://zhidao.baidu.com/search?word=window.location&fr=qb_search_exp&ie=utf8" rel="nofollow" style="color: rgb(45, 100, 179); text-decoration: none;">window.location</a>.href";
setTimeout("abc()",10000);
}
刷新本页:
Response.Write("<script language=javascript>window.location.href=window.location.href;</script>")
刷新父页:
Response.Write("<script language=javascript>opener.location.href=opener.location.href;</script>")
转到指定页:
Response.Write("<script language=javascript>window.location.href='yourpage.aspx';</script>")
</pre><pre id="answer-content-1088466239" class="answer-text mb-10" name="code" style="white-space: pre-wrap; word-wrap: break-word; color: rgb(51, 51, 51); font-size: 14px; margin-top: 0px; margin-bottom: 10px; padding: 0px; font-family: arial, 'courier new', courier, 宋体, monospace; line-height: 24px; background-color: rgb(255, 255, 255);">
</pre><pre id="answer-content-1088466239" class="answer-text mb-10" name="code" style="white-space: pre-wrap; word-wrap: break-word; color: rgb(51, 51, 51); font-size: 14px; margin-top: 0px; margin-bottom: 10px; padding: 0px; font-family: arial, 'courier new', courier, 宋体, monospace; line-height: 24px; background-color: rgb(255, 255, 255);">
<span style="font-family: Arial, Tahoma, Verdana, sans-serif; line-height: 25px; background-color: rgb(221, 237, 251);">Javascript刷新页面的几种方法: </span><br style="font-family: Arial, Tahoma, Verdana, sans-serif; line-height: 25px;" /><span style="font-family: Arial, Tahoma, Verdana, sans-serif; line-height: 25px; background-color: rgb(221, 237, 251);">1 history.go(0) </span><br style="font-family: Arial, Tahoma, Verdana, sans-serif; line-height: 25px;" /><span style="font-family: Arial, Tahoma, Verdana, sans-serif; line-height: 25px; background-color: rgb(221, 237, 251);">2 location.reload() </span><br style="font-family: Arial, Tahoma, Verdana, sans-serif; line-height: 25px;" /><span style="font-family: Arial, Tahoma, Verdana, sans-serif; line-height: 25px; background-color: rgb(221, 237, 251);">3 location=location </span><br style="font-family: Arial, Tahoma, Verdana, sans-serif; line-height: 25px;" /><span style="font-family: Arial, Tahoma, Verdana, sans-serif; line-height: 25px; background-color: rgb(221, 237, 251);">4 location.assign(location) </span><br style="font-family: Arial, Tahoma, Verdana, sans-serif; line-height: 25px;" /><span style="font-family: Arial, Tahoma, Verdana, sans-serif; line-height: 25px; background-color: rgb(221, 237, 251);">5 document.execCommand('Refresh') </span><br style="font-family: Arial, Tahoma, Verdana, sans-serif; line-height: 25px;" /><span style="font-family: Arial, Tahoma, Verdana, sans-serif; line-height: 25px; background-color: rgb(221, 237, 251);">6 window.navigate(location) </span><br style="font-family: Arial, Tahoma, Verdana, sans-serif; line-height: 25px;" /><span style="font-family: Arial, Tahoma, Verdana, sans-serif; line-height: 25px; background-color: rgb(221, 237, 251);">7 location.replace(location) </span><br style="font-family: Arial, Tahoma, Verdana, sans-serif; line-height: 25px;" /><span style="font-family: Arial, Tahoma, Verdana, sans-serif; line-height: 25px; background-color: rgb(221, 237, 251);">8 document.URL=location.href </span>
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值