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.
____________________________________________
框架頁中:(框架頁中其中一個子頁)
top.location.reload(); 刷新整頁
self.location.reload(); 刷新本頁
window.parent.location.href='' 框架頁重定向
_____________________________________________
自動刷新頁面的方法:1.頁面自動刷新:把如下代碼加入<head>區域中<meta http-equiv="refresh" content="20">其中20指每隔20秒刷新一次頁面.<body onload="opener.location.reload()"> 開窗時刷新<body onUnload="opener.location.reload()"> 關閉時刷新。
例:數據添加成功后彈出對話框并刷新頁面
if (infoAction_Sort.Insert(info_Sort))
{
ScriptManager.RegisterStartupScript(this.UpdatePanel, this.GetType(), "alert", "alert('相冊分類添加成功');window.location.reload();", true);
//Alert("相冊分類創建成功");
//Response.Redirect(Request.Url.ToString());//刷新本頁
this.txt_AddSort.Text = "";
this.txt_SortDepict.Text = "";
}
更多JS刷新頁面的幾種方法相關文章請關注PHP中文網!
聲明:本網頁內容旨在傳播知識,若有侵權等問題請及時與本網聯系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com