一:JS 重載頁面,本地刷新,返回上一頁
代碼如下:
返回上一頁
重載頁面,本地刷新
返回上一頁重載頁面,本地刷新
返回前二頁并刷新的JS代碼應該怎樣寫。
代碼如下:
history.go(-2); location.reload(); window.history.go(-1);//返回上一頁不刷新 window.location.href = document.referrer;//返回上一頁并刷新
二:js 方法
代碼如下:
asp自動返回并刷新的方法:
代碼如下:
response.Write(““)
一般用于向一個頁面提交action后返回前一頁并刷新!
Javascript 返回上一頁history.go(-1), 返回兩個頁面: history.go(-2); history.back(). window.history.forward()返回下一頁 window.history.go(返回第幾頁,也可以使用訪問過的URL)
response.Write(“") response.Write("if(!confirm('完成任務?')){history.back();}") “) response.Write(““)
向上一頁
頁面跳轉:
onclick=”window.location.href=’list.aspx’”
P.S.
小技巧(JS引用JS):
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.頁面自動刷新:把如下代碼加入區域中
其中20指每隔20秒刷新一次頁面.
2.頁面自動跳轉
3.頁面自動刷新js版
function myrefresh() { window.location.reload(); } setTimeout('myrefresh()',1000); //指定1秒刷新一次
ASP.NET如何輸出刷新父窗口腳本語句
1. this.response.write(““); 2. this.response.write(““); 3. Response.Write(““)
JS刷新框架的腳本語句
//如何刷新包含該框架的頁面用
parent.location.reload();
//子窗口刷新父窗口
self.opener.location.reload();
( 或 刷新 )
//如何刷新另一個框架的頁面用
parent.另一FrameID.location.reload();
如果想關閉窗口時刷新或者想開窗時刷新的話,在中調用以下語句即可。
開窗時刷新
關閉時刷新
window.opener.document.location.reload()
三:在ASP中利用JS實現返回上一頁并刷新
在ASP中利用JS實現返回上一頁并刷新我想是利用ASP開發網站的時候經常使用的。但寫法也有幾種,但目的都是一樣的。
代碼如下:
用iframe、彈出子頁面刷新父頁面iframe parent.location.reload(); 彈出子頁面 window.opener.location.reload(); 子窗口刷新父窗口 self.opener.location.reload(); 刷新以open()方法打開的窗口 window.opener.location.href=window.opener.location.href; 刷新以winodw.showModelDialog()方法打開的窗口 window.parent.dialogArguments.document.execCommand('Refresh');
js頁面跳轉:本頁面跳轉,上一層頁面跳轉,最外層的頁面跳轉,下面為大家大家分享下不同頁面之家的跳轉問題,感興趣的朋友可以學習下 “window.location.href”、”location.href”是本頁面跳轉 “parent.location.href”是上一層頁面跳轉 “top.location.href”是最外層的頁面跳轉 舉例說明: 如果A,B,C,D都是jsp,D是C的iframe,C是B的iframe,B是A的iframe,如果D中js這樣寫 “window.location.href”、”location.href”:D頁面跳轉 “parent.location.href”:C頁面跳轉 “top.location.href”:A頁面跳轉 如果D頁面中有form的話, : form提交后D頁面跳轉 : form提交后彈出新頁面 : form提交后C頁面跳轉 : form提交后A頁面跳轉 關于頁面刷新,D 頁面中這樣寫: “parent.location.reload();”: C頁面刷新 (當然,也可以使用子窗口的 opener 對象來獲得父窗口的對象:window.opener.document.location.reload(); ) “top.location.reload();”: A頁面刷新
聲明:本網頁內容旨在傳播知識,若有侵權等問題請及時與本網聯系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com