一:JS 重載頁面,本地刷新,返回上一頁
代碼如下:
返回上一頁
重載頁面,本地刷新
返回上一頁重載頁面,本地刷新
返回前二頁并刷新的JS代碼應(yīng)該怎樣寫。
代碼如下:
history.go(-2); location.reload(); window.history.go(-1);//返回上一頁不刷新 window.location.href = document.referrer;//返回上一頁并刷新
二:js 方法
代碼如下:
asp自動(dòng)返回并刷新的方法:
代碼如下:
response.Write(““)
一般用于向一個(gè)頁面提交action后返回前一頁并刷新!
Javascript 返回上一頁history.go(-1), 返回兩個(gè)頁面: history.go(-2); history.back(). window.history.forward()返回下一頁 window.history.go(返回第幾頁,也可以使用訪問過的URL)
response.Write(“") response.Write("if(!confirm('完成任務(wù)?')){history.back();}") “) response.Write(““)
向上一頁
頁面跳轉(zhuǎn):
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
自動(dòng)刷新頁面的方法:
1.頁面自動(dòng)刷新:把如下代碼加入?yún)^(qū)域中
其中20指每隔20秒刷新一次頁面.
2.頁面自動(dòng)跳轉(zhuǎn)
3.頁面自動(dòng)刷新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();
( 或 刷新 )
//如何刷新另一個(gè)框架的頁面用
parent.另一FrameID.location.reload();
如果想關(guān)閉窗口時(shí)刷新或者想開窗時(shí)刷新的話,在中調(diào)用以下語句即可。
開窗時(shí)刷新
關(guān)閉時(shí)刷新
window.opener.document.location.reload()
三:在ASP中利用JS實(shí)現(xiàn)返回上一頁并刷新
在ASP中利用JS實(shí)現(xiàn)返回上一頁并刷新我想是利用ASP開發(fā)網(wǎng)站的時(shí)候經(jīng)常使用的。但寫法也有幾種,但目的都是一樣的。
代碼如下:
用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頁面跳轉(zhuǎn):本頁面跳轉(zhuǎn),上一層頁面跳轉(zhuǎn),最外層的頁面跳轉(zhuǎn),下面為大家大家分享下不同頁面之家的跳轉(zhuǎn)問題,感興趣的朋友可以學(xué)習(xí)下 “window.location.href”、”location.href”是本頁面跳轉(zhuǎn) “parent.location.href”是上一層頁面跳轉(zhuǎn) “top.location.href”是最外層的頁面跳轉(zhuǎn) 舉例說明: 如果A,B,C,D都是jsp,D是C的iframe,C是B的iframe,B是A的iframe,如果D中js這樣寫 “window.location.href”、”location.href”:D頁面跳轉(zhuǎn) “parent.location.href”:C頁面跳轉(zhuǎn) “top.location.href”:A頁面跳轉(zhuǎn) 如果D頁面中有form的話, : form提交后D頁面跳轉(zhuǎn) : form提交后彈出新頁面 : form提交后C頁面跳轉(zhuǎn) : form提交后A頁面跳轉(zhuǎn) 關(guān)于頁面刷新,D 頁面中這樣寫: “parent.location.reload();”: C頁面刷新 (當(dāng)然,也可以使用子窗口的 opener 對(duì)象來獲得父窗口的對(duì)象:window.opener.document.location.reload(); ) “top.location.reload();”: A頁面刷新
聲明:本網(wǎng)頁內(nèi)容旨在傳播知識(shí),若有侵權(quán)等問題請(qǐng)及時(shí)與本網(wǎng)聯(lián)系,我們將在第一時(shí)間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com