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

  • <legend id='dW8Nv'><style id='dW8Nv'><dir id='dW8Nv'><q id='dW8Nv'></q></dir></style></legend>
  • <small id='dW8Nv'></small><noframes id='dW8Nv'>

      <bdo id='dW8Nv'></bdo><ul id='dW8Nv'></ul>

        <tfoot id='dW8Nv'></tfoot>
        <i id='dW8Nv'><tr id='dW8Nv'><dt id='dW8Nv'><q id='dW8Nv'><span id='dW8Nv'><b id='dW8Nv'><form id='dW8Nv'><ins id='dW8Nv'></ins><ul id='dW8Nv'></ul><sub id='dW8Nv'></sub></form><legend id='dW8Nv'></legend><bdo id='dW8Nv'><pre id='dW8Nv'><center id='dW8Nv'></center></pre></bdo></b><th id='dW8Nv'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='dW8Nv'><tfoot id='dW8Nv'></tfoot><dl id='dW8Nv'><fieldset id='dW8Nv'></fieldset></dl></div>

        XMLHttpRequest 的 onerror 處理程序應該何時觸發

        When should XMLHttpRequest#39;s onerror handler fire(XMLHttpRequest 的 onerror 處理程序應該何時觸發)
          <tbody id='BJ8ng'></tbody>

        • <small id='BJ8ng'></small><noframes id='BJ8ng'>

        • <i id='BJ8ng'><tr id='BJ8ng'><dt id='BJ8ng'><q id='BJ8ng'><span id='BJ8ng'><b id='BJ8ng'><form id='BJ8ng'><ins id='BJ8ng'></ins><ul id='BJ8ng'></ul><sub id='BJ8ng'></sub></form><legend id='BJ8ng'></legend><bdo id='BJ8ng'><pre id='BJ8ng'><center id='BJ8ng'></center></pre></bdo></b><th id='BJ8ng'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='BJ8ng'><tfoot id='BJ8ng'></tfoot><dl id='BJ8ng'><fieldset id='BJ8ng'></fieldset></dl></div>
          <tfoot id='BJ8ng'></tfoot>

            <legend id='BJ8ng'><style id='BJ8ng'><dir id='BJ8ng'><q id='BJ8ng'></q></dir></style></legend>
              <bdo id='BJ8ng'></bdo><ul id='BJ8ng'></ul>
                  本文介紹了XMLHttpRequest 的 onerror 處理程序應該何時觸發的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我在理解 XMLHttpRequest 的處理程序時有點問題.規范說明了 onerror 處理程序:

                  I have a little problem understanding XMLHttpRequest's handlers. The specification says this about the onerror handler:

                  error [Dispatched ... ] 請求失敗時.

                  error [Dispatched ... ] When the request has failed.

                  load [Dispatched ... ] 當請求成功完成時.

                  load [Dispatched ... ] When the request has successfully completed.

                  問題是,請求失敗"是什么意思.那可能是

                  The problem is, what does it mean that "the request has failed". That could be

                  • 根本無法發出請求(例如,連接被拒絕和此類錯誤),或者
                  • 上面加上服務器返回了一個錯誤代碼(例如404)

                  另外,我想知道這是否意味著 onerroronload 不應該同時觸發.

                  Also, I'd like to know whether it means onerror and onload should never fire simultaneously.

                  此引用 表示應該執行 onerror 處理程序取決于 status 代碼和 onload 取決于 readyState.這表明它們并不相互排斥,但是,我認為這不是權威信息.

                  This reference indicates the onerror handler should be executed depending on the status code and onload depending on readyState. That would indicate they are not mutually exclusive, however, I don't think this is an authoritative information.

                  我問是因為使用最新的 Opera 快照,我發現即使在 404 狀態碼上也會觸發 onload.我知道測試 status 是肯定的,但我想知道這是我必須按照規范執行的操作,還是只是解決 Opera 中的錯誤的一種解決方法.

                  I'm asking because using the latest Opera snapshot, I found onload is fired even on 404 status code. I know testing status is a sure bet, but I'd like to know whether it's something I have to do per specification or just a workaround for a bug in Opera.

                  推薦答案

                  正如評論中提到的,onerror網絡級別出現故障時觸發.如果錯誤僅存在于應用程序級別,例如,發送了 HTTP 錯誤代碼,則 onload 仍然會觸發.您需要在 onreadystatechange 處理程序中顯式測試返回的狀態代碼.

                  As mentioned in the comments, onerror fires when there is a failure on the network level. If the error only exists on the application level, e.g., an HTTP error code is sent, then onload still fires. You need to test the returned status code explicitly in your onreadystatechange handler.

                  請注意,被拒絕的跨域請求也會觸發 onerror 處理程序.

                  Note that a denied cross-domain request will also fire the onerror handler.

                  這篇關于XMLHttpRequest 的 onerror 處理程序應該何時觸發的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

                  相關文檔推薦

                  Browser waits for ajax call to complete even after abort has been called (jQuery)(即使在調用 abort (jQuery) 之后,瀏覽器也會等待 ajax 調用完成)
                  JavaScript innerHTML is not working for IE?(JavaScript innerHTML 不適用于 IE?)
                  XMLHttpRequest cannot load, No #39;Access-Control-Allow-Origin#39; header is present on the requested resource(XMLHttpRequest 無法加載,請求的資源上不存在“Access-Control-Allow-Origin標頭) - IT屋-程序員軟件開發技術分
                  Is it possible for XHR HEAD requests to not follow redirects (301 302)(XHR HEAD 請求是否有可能不遵循重定向 (301 302))
                  NETWORK_ERROR: XMLHttpRequest Exception 101(NETWORK_ERROR:XMLHttpRequest 異常 101)
                  XMLHttpRequest 206 Partial Content(XMLHttpRequest 206 部分內容)

                    <tbody id='vSvC8'></tbody>

                  • <i id='vSvC8'><tr id='vSvC8'><dt id='vSvC8'><q id='vSvC8'><span id='vSvC8'><b id='vSvC8'><form id='vSvC8'><ins id='vSvC8'></ins><ul id='vSvC8'></ul><sub id='vSvC8'></sub></form><legend id='vSvC8'></legend><bdo id='vSvC8'><pre id='vSvC8'><center id='vSvC8'></center></pre></bdo></b><th id='vSvC8'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='vSvC8'><tfoot id='vSvC8'></tfoot><dl id='vSvC8'><fieldset id='vSvC8'></fieldset></dl></div>

                        <bdo id='vSvC8'></bdo><ul id='vSvC8'></ul>

                        <legend id='vSvC8'><style id='vSvC8'><dir id='vSvC8'><q id='vSvC8'></q></dir></style></legend>
                      • <small id='vSvC8'></small><noframes id='vSvC8'>

                          • <tfoot id='vSvC8'></tfoot>
                            主站蜘蛛池模板: 91亚洲国产精品 | 国产亚洲精品精品国产亚洲综合 | 性高湖久久久久久久久aaaaa | 日韩欧美在线观看 | 一区二区三区视频播放 | 国产激情片在线观看 | 久久综合久久综合久久 | 欧美a区 | 日韩欧美中文字幕在线观看 | 国产一区二区三区视频免费观看 | 国产成人免费视频网站高清观看视频 | 99久久精品国产毛片 | 欧美黄色一区 | 中文在线一区二区 | 日韩一区二区在线视频 | 一区二区日韩 | 精品国产91 | 一区二区精品 | 中文字幕日韩一区 | chengrenzaixian| 一区二区三区中文字幕 | 日本不卡一区二区三区在线观看 | 欧美成人黄色小说 | av一区二区三区在线观看 | 欧美电影网 | 玖草资源 | 黑人巨大精品欧美一区二区免费 | 成人国产在线视频 | 免费看国产a | 亚洲精品一区在线 | 青青草一区二区三区 | 五月婷亚洲 | 成人在线网址 | 黄视频在线网站 | 国产精品亚洲一区 | a级黄色片在线观看 | 国产精品一区一区 | 久久看片| 久久成人一区二区三区 | 欧美福利影院 | 91中文字幕在线观看 |