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
自動重新整理頁面的方法:
1.頁面自動重新整理:把如下代碼加入<head>地區中
<meta http-equiv="refresh" content="20">
其中20指每隔20秒重新整理一次頁面.
2.頁面自動跳轉:把如下代碼加入<head>地區中
<meta http-equiv="refresh" content="20;url=http://www.wyxg.com">
其中20指隔20秒後跳轉到http://www.wyxg.com頁面
3.頁面自動重新整理js版
<script language="JavaScript">
function myrefresh()
{
window.location.reload();
}
setTimeout('myrefresh()',1000); //指定1秒重新整理一次
</script>
JS重新整理架構的指令碼語句
//如何重新整理包含該架構的頁面用
<script language=JavaScript>
parent.location.reload();
</script>
//子視窗重新整理父視窗
<script language=JavaScript>
self.opener.location.reload();
</script>
( 或 <a href="javascript:opener.location.reload()">重新整理</a> )
//如何重新整理另一個架構的頁面用
<script language=JavaScript>
parent.另一FrameID.location.reload();
</script>
如果想關閉視窗時重新整理或者想開窗時重新整理的話,在<body>中調用以下語句即可。
<body onload="opener.location.reload()"> 開窗時重新整理
<body onUnload="opener.location.reload()"> 關閉時重新整理
<script language="javascript">
window.opener.document.location.reload()
如果想在重新整理時不彈出提示可以用:
window.location.href=window.location.href ;
window.location.reload;
但是window.location.href="要重新整理的頁面",在ie7中沒有問題,在ie6和遨遊中就不行,而window.location.reload()就可以,要多注意啦
<js基礎>--javascript重新整理頁面
1.Response.Write("<script language=javascript>parent.left.document.location.reload();</script>");
2.Response.Write("<script>window.top.location='login.aspx';window.close</script>");
3.this.RegisterStartupScript("reload","<script>window.parent.frames('left').location.reload(true);</script>"); 或 this.RegisterStartupScript("reload","<script>window.parent.frames('left').location.href=window.parent.frames('left').location.href;</script>");