国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 網(wǎng)站 > WEB開發(fā) > 正文

window.location.href/replace/reload()--頁(yè)面跳轉(zhuǎn)+替換+刷新

2024-04-27 15:08:40
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友

一、最外層top跳轉(zhuǎn)頁(yè)面,適合用于iframe框架集top.window.location.href("${pageContext.request.contextPath}/Login_goBack");============================================================================================二、window.location.href和window.location.replace的區(qū)別 1.window.location.href=“url”:改變url地址; 2.window.location.replace(“url”):將地址替換成新url,該方法通過(guò)指定URL替換當(dāng)前緩存在歷史里(客戶端)的項(xiàng)目,因此當(dāng)使用replace方法之后,你不能通過(guò)“前進(jìn)”和“后 退”來(lái)訪問(wèn)已經(jīng)被替換的URL,這個(gè)特點(diǎn)對(duì)于做一些過(guò)渡頁(yè)面非常有用!三、強(qiáng)制頁(yè)面刷新 1.window.location.reload():強(qiáng)制刷新頁(yè)面,從服務(wù)器重新請(qǐng)求! ============================================================================================四、window.location.reload();頁(yè)面實(shí)現(xiàn)跳轉(zhuǎn)和刷新 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這幾個(gè)都可以刷新window.location.reload();刷新window.location.href=window.location.href;刷新window.close();關(guān)閉窗口,不彈出系統(tǒng)提示,直接關(guān)閉 window.close()相當(dāng)于self屬性是當(dāng)前窗口window.parent.close()是parent屬性是當(dāng)前窗口或框架的框架組頁(yè)面實(shí)現(xiàn)跳轉(zhuǎn)的九種方法實(shí)例:<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>navigate</title><script language="javaScript">    setTimeout('window.navigate("top.html");',2000);    setTimeout('window.document.location.href="top.html";',2000);    setTimeout('window.document.location="top.html";',2000);    setTimeout('window.location.href="top.html";',2000);    setTimeout('window.location="top.html";',2000);    setTimeout('document.location.href="top.html";',2000);                  setTimeout('document.location="top.html";',2000);    setTimeout('location.href="top.html";',2000);    setTimeout('location.replace("top.html")',2000);    //window對(duì)象        //document對(duì)象            //location對(duì)象                //href屬性                //1.window.document.location.href                //2.window.document.location                //3.window.location.href                //4.window.location                               //5.document.location.href                //6.document.location                //7.location.href                //8.window.navigate                //9.location.replace                //只要使用location方法,和任意的window對(duì)象,location對(duì)象,href屬性連用,都可以頁(yè)面的跳轉(zhuǎn)//// </script></head><body>頁(yè)面將在2秒后跳轉(zhuǎn)</body></html>解釋:location是個(gè)對(duì)象,比如本頁(yè)的document.location和window.location的屬性有      location.hostname   =   community.csdn.NET   location.href   =   http://community.csdn.Net/Expert/topic/4033/4033372.xml?temp=2.695864E-02   location.host   =   community.csdn.net   location.hash   =     location.port   =     location.pathname   =   /Expert/topic/4033/4033372.xml   location.search   =   ?temp=2.695864E-02   location.PRotocol   =   http:   可見href是location的屬性,類別是string。

轉(zhuǎn)自:http://blog.csdn.net/wuya145/article/details/9114603


發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 基隆市| 涿州市| 汝州市| 山西省| 和林格尔县| 呈贡县| 晋中市| 买车| 德州市| 贵阳市| 乐陵市| 嘉义市| 内黄县| 鹤庆县| 枞阳县| 红原县| 昔阳县| 青川县| 依兰县| 珠海市| 丰台区| 张家口市| 准格尔旗| 鱼台县| 鹤庆县| 海丰县| 天全县| 郴州市| 通河县| 泾川县| 大竹县| 漳州市| 疏附县| 钦州市| 衡阳市| 黄浦区| 大冶市| 武清区| 和田县| 陇南市| 邢台市|