pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

<tfoot id='4uoAW'></tfoot>
    1. <small id='4uoAW'></small><noframes id='4uoAW'>

          <bdo id='4uoAW'></bdo><ul id='4uoAW'></ul>
      1. <i id='4uoAW'><tr id='4uoAW'><dt id='4uoAW'><q id='4uoAW'><span id='4uoAW'><b id='4uoAW'><form id='4uoAW'><ins id='4uoAW'></ins><ul id='4uoAW'></ul><sub id='4uoAW'></sub></form><legend id='4uoAW'></legend><bdo id='4uoAW'><pre id='4uoAW'><center id='4uoAW'></center></pre></bdo></b><th id='4uoAW'></th></span></q></dt></tr></i><div class="5jxxfth" id='4uoAW'><tfoot id='4uoAW'></tfoot><dl id='4uoAW'><fieldset id='4uoAW'></fieldset></dl></div>
      2. <legend id='4uoAW'><style id='4uoAW'><dir id='4uoAW'><q id='4uoAW'></q></dir></style></legend>

        window.history.pushState 刷新瀏覽器

        window.history.pushState refreshing the browser(window.history.pushState 刷新瀏覽器)
      3. <i id='ksrW4'><tr id='ksrW4'><dt id='ksrW4'><q id='ksrW4'><span id='ksrW4'><b id='ksrW4'><form id='ksrW4'><ins id='ksrW4'></ins><ul id='ksrW4'></ul><sub id='ksrW4'></sub></form><legend id='ksrW4'></legend><bdo id='ksrW4'><pre id='ksrW4'><center id='ksrW4'></center></pre></bdo></b><th id='ksrW4'></th></span></q></dt></tr></i><div class="5pnxfhh" id='ksrW4'><tfoot id='ksrW4'></tfoot><dl id='ksrW4'><fieldset id='ksrW4'></fieldset></dl></div>
          <bdo id='ksrW4'></bdo><ul id='ksrW4'></ul>

              1. <tfoot id='ksrW4'></tfoot>

                <small id='ksrW4'></small><noframes id='ksrW4'>

                <legend id='ksrW4'><style id='ksrW4'><dir id='ksrW4'><q id='ksrW4'></q></dir></style></legend>
                  <tbody id='ksrW4'></tbody>
                  本文介紹了window.history.pushState 刷新瀏覽器的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                  問(wèn)題描述

                  我正在編寫(xiě)一些 javascript 代碼,并使用 window.History.pushState 加載新的 HTML 頁(yè)面,而不是使用 href 標(biāo)簽.我的代碼(工作正常)看起來(lái)像這樣.

                  I am working on some javascript code, and using window.History.pushState to load new HTML pages, instead of using href tags. My code (which is working fine) looks like this.

                  window.History.pushState({urlPath:'/page1'},"",'/page1')
                  

                  奇怪的是,這個(gè)失敗,即重新加載瀏覽器

                  strangely, this fails, ie reloads the browser

                  window.History.pushState({urlPath:'/page2.php'},"",'/page2.php')
                  

                  但是這個(gè)有效,內(nèi)容更新了,瀏覽器沒(méi)有刷新!(注意 URL 是絕對(duì)的而不是相對(duì)的)

                  But this works, content is updated, browser not refreshed ! (notice the URL is absolute and not relative)

                  window.History.pushState({urlPath:'www.domain.com/page2.php'},"",'www.domain.com/page2.php')
                  

                  window.History.pushState 的文檔 表示第三個(gè)參數(shù) URL 可以是絕對(duì)的也可以是相對(duì)的 -

                  The documentation for window.History.pushState says that the third parameter URL can be either absolute or relative -

                  URL — 新歷史條目的 URL 由該參數(shù)給出.筆記瀏覽器不會(huì)在調(diào)用后嘗試加載此 URLpushState(),但它可能會(huì)稍后嘗試加載 URL,例如用戶重新啟動(dòng)瀏覽器后.新的 URL 不需要絕對(duì);如果是相對(duì)的,則相對(duì)于當(dāng)前 URL 進(jìn)行解析.新 URL 必須與當(dāng)前 URL 同源;否則,pushState() 將拋出異常.該參數(shù)是可選的;如果它沒(méi)有指定,它被設(shè)置為文檔的當(dāng)前 URL.

                  URL — The new history entry's URL is given by this parameter. Note that the browser won't attempt to load this URL after a call to pushState(), but it might attempt to load the URL later, for instance after the user restarts the browser. The new URL does not need to be absolute; if it's relative, it's resolved relative to the current URL. The new URL must be of the same origin as the current URL; otherwise, pushState() will throw an exception. This parameter is optional; if it isn't specified, it's set to the document's current URL.

                  絕對(duì) URL 似乎有效,但相對(duì) URL 似乎無(wú)效.為什么會(huì)發(fā)生這種情況?

                  Absolute URLs seem to be working but relative seem to be not. Why is this happening?

                  推薦答案

                  簡(jiǎn)短的回答是 history.pushState(不是 History.pushState,它會(huì)拋出異常,window 部分是可選的)永遠(yuǎn)不會(huì)做你的建議.

                  The short answer is that history.pushState (not History.pushState, which would throw an exception, the window part is optional) will never do what you suggest.

                  如果頁(yè)面正在刷新,那么它是由您正在做的其他事情引起的(例如,在地址欄更改的情況下,您可能正在運(yùn)行的代碼會(huì)轉(zhuǎn)到新位置).

                  If pages are refreshing, then it is caused by other things that you are doing (for example, you might have code running that goes to a new location in the case of the address bar changing).

                  history.pushState({urlPath:'/page2.php'},"",'/page2.php') 與最新版本的 Chrome、IE 完全一樣和 Firefox 給我和我的同事.

                  history.pushState({urlPath:'/page2.php'},"",'/page2.php') works exactly like it is supposed to in the latest versions of Chrome, IE and Firefox for me and my colleagues.

                  事實(shí)上,你可以在函數(shù)中放入任何你喜歡的東西:history.pushState({}, '', '這么久,感謝所有的魚(yú).不是一個(gè)真正的文件').

                  In fact you can put whatever you like into the function: history.pushState({}, '', 'So long and thanks for all the fish.not a real file').

                  如果您發(fā)布更多代碼(特別注意 history.pushState 附近和使用 document.location 的任何地方的代碼),那么我們將不止很樂(lè)意幫助您找出此問(wèn)題的確切原因.

                  If you post some more code (with special attention for code nearby the history.pushState and anywhere document.location is used), then we'll be more than happy to help you figure out where exactly this issue is coming from.

                  如果你發(fā)布更多代碼,我會(huì)更新這個(gè)答案(我最喜歡你的問(wèn)題):)

                  If you post more code, I'll update this answer (I have your question favourited) :).

                  這篇關(guān)于window.history.pushState 刷新瀏覽器的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

                  相關(guān)文檔推薦

                  Deadlock exception code for PHP, MySQL PDOException?(PHP、MySQL PDOException 的死鎖異常代碼?)
                  PHP PDO MySQL scrollable cursor doesn#39;t work(PHP PDO MySQL 可滾動(dòng)游標(biāo)不起作用)
                  PHP PDO ODBC connection(PHP PDO ODBC 連接)
                  Using PDO::FETCH_CLASS with Magic Methods(使用 PDO::FETCH_CLASS 和魔術(shù)方法)
                  php pdo get only one value from mysql; value that equals to variable(php pdo 只從 mysql 獲取一個(gè)值;等于變量的值)
                  MSSQL PDO could not find driver(MSSQL PDO 找不到驅(qū)動(dòng)程序)
                    <tbody id='5uyJa'></tbody>

                    <small id='5uyJa'></small><noframes id='5uyJa'>

                        • <bdo id='5uyJa'></bdo><ul id='5uyJa'></ul>

                          <legend id='5uyJa'><style id='5uyJa'><dir id='5uyJa'><q id='5uyJa'></q></dir></style></legend><tfoot id='5uyJa'></tfoot>

                            <i id='5uyJa'><tr id='5uyJa'><dt id='5uyJa'><q id='5uyJa'><span id='5uyJa'><b id='5uyJa'><form id='5uyJa'><ins id='5uyJa'></ins><ul id='5uyJa'></ul><sub id='5uyJa'></sub></form><legend id='5uyJa'></legend><bdo id='5uyJa'><pre id='5uyJa'><center id='5uyJa'></center></pre></bdo></b><th id='5uyJa'></th></span></q></dt></tr></i><div class="0oms2ie" id='5uyJa'><tfoot id='5uyJa'></tfoot><dl id='5uyJa'><fieldset id='5uyJa'></fieldset></dl></div>
                            主站蜘蛛池模板: 定硫仪,量热仪,工业分析仪,马弗炉,煤炭化验设备厂家,煤质化验仪器,焦炭化验设备鹤壁大德煤质工业分析仪,氟氯测定仪 | 济南网站策划设计_自适应网站制作_H5企业网站搭建_济南外贸网站制作公司_锐尚 | 数显恒温油浴-电砂浴-高温油浴振荡器-常州迈科诺仪器有限公司 | 高压油管,液压接头,液压附件-烟台市正诚液压附件 | 福建自考_福建自学考试网 | 探鸣起名网-品牌起名-英文商标起名-公司命名-企业取名包满意 | 合肥角钢_合肥槽钢_安徽镀锌管厂家-昆瑟商贸有限公司 | 河南凯邦机械制造有限公司| 砂尘试验箱_淋雨试验房_冰水冲击试验箱_IPX9K淋雨试验箱_广州岳信试验设备有限公司 | 武汉高温老化房,恒温恒湿试验箱,冷热冲击试验箱-武汉安德信检测设备有限公司 | 工业设计,人工智能,体验式3D展示的智能技术交流服务平台-纳金网 J.S.Bach 圣巴赫_高端背景音乐系统_官网 | 西门子代理商_西门子变频器总代理-翰粤百科 | 选矿设备-新型重选设备-金属矿尾矿重选-青州冠诚重工机械有限公司 | 网优资讯-为循环资源、大宗商品、工业服务提供资讯与行情分析的数据服务平台 | 青岛侦探_青岛侦探事务所_青岛劝退小三_青岛调查出轨取证公司_青岛婚外情取证-青岛探真调查事务所 | 金刚网,金刚网窗纱,不锈钢网,金刚网厂家- 河北萨邦丝网制品有限公司 | 工业rfid读写器_RFID工业读写器_工业rfid设备厂商-ANDEAWELL | 算命免费_生辰八字_免费在线算命 - 卜算子算命网 | 企小优-企业数字化转型服务商_网络推广_网络推广公司 | 消泡剂-水处理消泡剂-涂料消泡剂-切削液消泡剂价格-东莞德丰消泡剂厂家 | VOC检测仪-甲醛检测仪-气体报警器-气体检测仪厂家-深恒安科技有限公司 | SOUNDWELL 编码器|电位器|旋转编码器|可调电位器|编码开关厂家-广东升威电子制品有限公司 | 合金ICP光谱仪(磁性材料,工业废水)-百科 | 高低温老化试验机-步入式/低温恒温恒湿试验机-百科 | 物流之家新闻网-最新物流新闻|物流资讯|物流政策|物流网-匡匡奈斯物流科技 | 作文导航网_作文之家_满分作文_优秀作文_作文大全_作文素材_最新作文分享发布平台 | 国产离子色谱仪,红外分光测油仪,自动烟尘烟气测试仪-青岛埃仑通用科技有限公司 | 泰国试管婴儿_泰国第三代试管婴儿_泰国试管婴儿费用/多少钱_孕泰来 | 高铝砖-高铝耐火球-高铝耐火砖生产厂家-价格【荣盛耐材】 | PCB厂|线路板厂|深圳线路板厂|软硬结合板厂|电路板生产厂家|线路板|深圳电路板厂家|铝基板厂家|深联电路-专业生产PCB研发制造 | 盘古网络技术有限公司 | 全屋整木定制-橱柜,家具定制-四川峨眉山龙马木业有限公司 | 郑州宣传片拍摄-TVC广告片拍摄-微电影短视频制作-河南优柿文化传媒有限公司 | 多功能三相相位伏安表-变压器短路阻抗测试仪-上海妙定电气 | 智慧农业|农业物联网|现代农业物联网-托普云农物联网官方网站 | 防火窗_耐火窗_防火门厂家_防火卷帘门-重庆三乐门业有限公司 | 密封圈_泛塞封_格莱圈-[东莞市国昊密封圈科技有限公司]专注密封圈定制生产厂家 | 筛分机|振动筛分机|气流筛分机|筛分机厂家-新乡市大汉振动机械有限公司 | 金环宇|金环宇电线|金环宇电缆|金环宇电线电缆|深圳市金环宇电线电缆有限公司|金环宇电缆集团 | 冷水机-冰水机-冷冻机-冷风机-本森智能装备(深圳)有限公司 | 动物麻醉机-数显脑立体定位仪-北京易则佳科技有限公司 |