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

来源:互联网 发布:上海医院 知乎 编辑:程序博客网 时间:2024/04/29 21:10
1)<meta http-equiv="refresh"content="10;url=跳转的页面">10表示间隔10秒刷新一次 2)<script language=''javascript''>window.location.reload(true);</script>如果是你要刷新某一个iframe就把window给换成frame的名字或ID号 3)<script language=''javascript''>window.navigate("本页面url");</script> 4>function abc(){window.location.href="/blog/window.location.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>")
Javascript刷新页面的几种方法: 
1 history.go(0) 
2 location.reload() 
3 location=location 
4 location.assign(location) 
5 document.execCommand('Refresh') 
6 window.navigate(location) 
7 location.replace(location) 
8 document.URL=location.href 
原创粉丝点击