久久久久久久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>
                            主站蜘蛛池模板: av在线一区二区三区 | 久久精品色欧美aⅴ一区二区 | 91免费福利在线 | a视频在线播放 | 精品中文字幕一区二区三区 | 国产精品污www一区二区三区 | 精品视频一区二区三区四区 | 国产精品不卡 | 天天综合亚洲 | 欧美精品一区二区三区蜜桃视频 | 亚洲一区二区三区久久久 | 亚洲一区在线播放 | 精品美女 | 女女百合av大片一区二区三区九县 | 国产乱码精品一区二区三区忘忧草 | 久久激情网 | 亚洲精品久久区二区三区蜜桃臀 | 午夜免费电影 | 亚洲第一av | 精品久久精品 | 一级爱爱片 | 99re在线视频观看 | 精品综合久久久 | 国产成人99久久亚洲综合精品 | 国产欧美一级二级三级在线视频 | 国产精品jizz在线观看老狼 | 一区二区在线不卡 | 观看av| 欧美日韩电影一区二区 | 欧美日韩亚洲在线 | 久久综合一区二区三区 | 北条麻妃一区二区三区在线观看 | 欧美精品免费观看二区 | 日韩国产三区 | 国产成人精品视频在线观看 | 五月天婷婷狠狠 | 亚洲人成人一区二区在线观看 | 亚洲日韩中文字幕一区 | 久久国产区 | 亚洲一区二区三区在线观看免费 | 亚洲午夜精品久久久久久app |