1)
<meta http-equiv="refresh" content="10">
10表示間隔10秒刷新一次
2)
<script>
window.location.reload(true);
</script>
如果是你要刷新某一個iframe就把window給換成frame的名字或ID號
3)
<script>
window.navigate("本頁面url");
</script>
>
function 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,ASP,JS)
‘by aloxy
定時刷新:
<script>setTimeout("location.href='url'",2000)</script>
說明:url是要刷新的頁面URL地址
2000是等待時間=2秒,
2.
說明:
n is the number of seconds to wait before loading the specified URL.
url is an absolute URL to be loaded.
n,是等待的時間,以秒為單位
url是要刷新的頁面URL地址
3.
說明:一般用一個url參數或者表單傳值判斷是否發生某個操作,然后利用response.redirect 刷新。
4.
刷新框架頁
〈script language=JavaScript>top.leftFrm.location.reload();parent.frmTop.location.reload(); 彈出窗體后再刷新的問題
Response.Write("<script>window.showModalDialog('../OA/SPCL.aspx',window,'dialogHeight: 300px; dialogWidth: 427px; dialogTop: 200px; dialogLeft: 133px')</script>");//open
Response.Write("<script>document.location=document.location;</script>");
在子窗體頁面代碼head中加入刷新的內容加在 if (!IsPostBack) 中
在框架頁中右面刷新左面
//刷新框架頁左半部分
Response.Write("<script>");
Response.Write("parent.left.location.href='PayDetailManage_Left.aspx'");
Response.Write("</script>");
頁面定時刷新功能實現
有三種方法:
1,在html中設置:
之後加入下面這一行即可!
定時刷新:
10代表刷新間隔,單位為秒
2.jsp
<!--esponse.setHeader("refresh","1");-->
每一秒刷新一次
3.使用JavaScript:
<script>
setTimeout("self.location.reload();",1000);
<script>
一秒一次
頁面自動跳轉:
1.在html中設置:
之後加入下面這一行即可!
定時跳轉並刷新: ,
其中20指隔20秒后跳轉到http://自己的URL 頁面。
點擊按鈕提交表單后刷新上級窗口
A窗口打開B窗口
然后在B里面提交數據至C窗口
最后要刷新A窗口
並且關閉B窗口
幾個JavaScript函數
//第一個自動關閉窗口
<script>
<!--<br /> function clock(){i=i-1<br /> document.title="本窗口將在"+i+"秒后自動關閉!";<br /> if(i>0)setTimeout("clock();",1000);<br /> else self.close();}<br /> var i=2<br /> clock();<br /> //-->
</script>
//第二個刷新父頁面的函數
<script>
opener.location.reload();
</script>