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

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

<tfoot id='cFOOV'></tfoot>

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

    2. <legend id='cFOOV'><style id='cFOOV'><dir id='cFOOV'><q id='cFOOV'></q></dir></style></legend>

      獲取 API 與 XMLHttpRequest

      Fetch API vs XMLHttpRequest(獲取 API 與 XMLHttpRequest)
        <bdo id='BWM8o'></bdo><ul id='BWM8o'></ul>

          <legend id='BWM8o'><style id='BWM8o'><dir id='BWM8o'><q id='BWM8o'></q></dir></style></legend>
        1. <tfoot id='BWM8o'></tfoot>

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

              <tbody id='BWM8o'></tbody>

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

              • 本文介紹了獲取 API 與 XMLHttpRequest的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                我知道 Fetch API 使用 Promise 并且它們都允許您向服務器發出 AJAX 請求.

                I know that Fetch API uses Promises and both of them allow you to do AJAX requests to a server.

                我了解到 Fetch API 有一些額外的功能,這些功能在 XMLHttpRequest 中不可用(在 Fetch API polyfill 中,因為它基于 XHR).

                I have read that Fetch API has some extra features, which aren't available in XMLHttpRequest (and in the Fetch API polyfill, since it's based on XHR).

                Fetch API 有哪些額外功能?

                What extra capabilities does the Fetch API have?

                推薦答案

                有些事情你可以用 fetch 而不是 XHR:

                There are a few things that you can do with fetch and not with XHR:

                • 您可以將緩存 API 與請求和響應對象一起使用;
                • 您可以執行 no-cors 請求,從未實現 CORS 的服務器獲取響應.您無法直接從 JavaScript 訪問響應正文,但您可以將其與其他 API(例如緩存 API)一起使用;
                • 流式響應(使用 XHR,整個響應緩沖在內存中,使用 fetch 您將能夠訪問低級流).尚未在所有瀏覽器中提供此功能,但很快就會提供.
                • You can use the Cache API with the request and response objects;
                • You can perform no-cors requests, getting a response from a server that doesn't implement CORS. You can't access the response body directly from JavaScript, but you can use it with other APIs (e.g. the Cache API);
                • Streaming responses (with XHR the entire response is buffered in memory, with fetch you will be able to access the low-level stream). This isn't available yet in all browsers, but will be soon.

                你可以用 XHR 做一些你不能用 fetch 做的事情,但它們遲早會可用(閱讀此處的未來改進"段落:https://hacks.mozilla.org/2015/03/this-api-就是這么拿取/):

                There are a couple of things that you can do with XHR that you can't do yet with fetch, but they're going to be available sooner or later (read the "Future improvements" paragraph here: https://hacks.mozilla.org/2015/03/this-api-is-so-fetching/):

                • 中止請求(這現在可以在 Firefox 和 Edge 中使用,正如 @sideshowbarker 在他的評論中解釋的那樣);
                • 報告進度.

                本文https://jakearchibald.com/2015/thats-so-fetch/ 包含更詳細的描述.

                This article https://jakearchibald.com/2015/thats-so-fetch/ contains a more detailed description.

                這篇關于獲取 API 與 XMLHttpRequest的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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='WTC5h'></tbody>
                • <legend id='WTC5h'><style id='WTC5h'><dir id='WTC5h'><q id='WTC5h'></q></dir></style></legend>

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

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

                          主站蜘蛛池模板: 日韩激情在线 | 亚洲91精品 | 亚洲国产精品福利 | 久久区二区 | 综合亚洲视频 | 色久五月| 高清免费在线 | 精品久久久久久久 | 粉嫩一区二区三区性色av | 在线看亚洲| 中文一区二区视频 | 一区二区在线 | 九九热在线视频观看这里只有精品 | 懂色中文一区二区在线播放 | 中文字幕av第一页 | 日本黄色一级视频 | 狠狠色综合欧美激情 | 91麻豆精品国产91久久久久久 | 国产色播av在线 | 亚洲激精日韩激精欧美精品 | 国产午夜精品视频 | 一级毛片观看 | 日本精品久久 | 欧美日韩国产高清 | 国产99在线 | 欧美 | 一区二区三区高清 | 亚洲成av人片在线观看 | 精品视频一区二区三区在线观看 | av免费在线观看网站 | av毛片在线播放 | 精品国产乱码久久久久久久久 | 中文字幕综合在线 | 97视频免费 | 国产欧美一区二区久久性色99 | 日韩精品在线观看免费 | 国外成人免费视频 | 亚洲一区二区三区观看 | 国产精品久久欧美久久一区 | 国产欧美在线 | 国产高清在线观看 | 国产精品伦理一区 |