基本刷新页面方法
10表示间隔10秒刷新一次<meta http-equiv="refresh"content="10;url=跳转的页面">
window.location.reload(true);
如果是你要刷新某一个iframe就把window给换成frame的名字或ID号
window.navigate("本页面url");
1
2
3
4function abc() {
window.location.href="/blog/window.location.href";
}
setTimeout("abc()",10000);
刷新本页:
Response.Write("<script>window.location.href=window.location.href;</script>");
刷新父页:
Response.Write("<script>opener.location.href=opener.location.href;</script>");
转到指定页:
Response.Write("<script>window.location.href='yourpage.aspx';</script>");
定时刷新页面方法
在html中设置
在
10代表刷新间隔,单位为秒。
<meta http-equiv="refresh" content="10">
jsp方法
1代表每一秒刷新一次。
<% response.setHeader("refresh","1"); %>
javascript方法
1000代表1000毫秒,即1秒。
setTimeout("self.location.reload();",1000);
关注 web翎云阁,定时推送,互动精彩多,若你有更好的见解,欢迎留言探讨!