久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

<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="qwawimqqmiuu" 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="qwawimqqmiuu" 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 刷新瀏覽器的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

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

                  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')
                  

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

                  strangely, this fails, ie reloads the browser

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

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

                  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 的文檔 表示第三個參數(shù) URL 可以是絕對的也可以是相對的 -

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

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

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

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

                  推薦答案

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

                  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.

                  如果頁面正在刷新,那么它是由您正在做的其他事情引起的(例如,在地址欄更改的情況下,您可能正在運行的代碼會轉(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ù)中放入任何你喜歡的東西:history.pushState({}, '', '這么久,感謝所有的魚.不是一個真正的文件').

                  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 的任何地方的代碼),那么我們將不止很樂意幫助您找出此問題的確切原因.

                  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ā)布更多代碼,我會更新這個答案(我最喜歡你的問題):)

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

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

                  【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(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 可滾動游標(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 獲取一個值;等于變量的值)
                  MSSQL PDO could not find driver(MSSQL PDO 找不到驅(qū)動程序)
                    <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="qwawimqqmiuu" id='5uyJa'><tfoot id='5uyJa'></tfoot><dl id='5uyJa'><fieldset id='5uyJa'></fieldset></dl></div>
                            主站蜘蛛池模板: 亚洲三区视频 | 亚洲成年影院 | 亚洲成人精品在线 | 国产福利观看 | 中文字幕日韩欧美一区二区三区 | 日本成年免费网站 | 国产精品久久久 | 亚洲精品在线免费看 | 操人网| 99久久精品国产一区二区三区 | 亚洲视频免费在线观看 | 国产精品久久久久久久久久久久久久 | 成人精品免费视频 | 亚洲欧美激情国产综合久久久 | 国产一区2区| 黄色毛片大全 | 蜜桃视频一区二区三区 | 91青娱乐在线 | 羞羞视频在线网站观看 | 亚洲www | 日韩精品一区二区三区高清免费 | 色婷婷综合久久久久中文一区二区 | 日本超碰 | 九九在线精品视频 | 国产成在线观看免费视频 | 欧美日韩久久精品 | 日韩在线国产精品 | 99热在线免费 | 亚洲欧洲成人 | 色综合一区二区三区 | 日韩手机在线视频 | 久久成人精品视频 | 亚洲成年在线 | 精品欧美激情在线观看 | 蜜桃视频在线观看www社区 | 亚洲 欧美 日韩 精品 | 久久精品91久久久久久再现 | 最新午夜综合福利视频 | 成人精品久久日伦片大全免费 | 久久国产免费 | 亚洲电影一区二区三区 |