標籤:style blog http io ar color os sp java
Javascript重新整理頁面的幾種方法:
1 history.go(0)2 location.reload()3 location=location4 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重新整理頁面的幾種方法