久久久久久久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>

                          主站蜘蛛池模板: 亚洲毛片 | 免费在线视频a | 欧美人成在线视频 | 男女污污网站 | 亚洲色图图片 | www.久久久久久久久久久久 | 精品美女久久久 | 日本韩国电影免费观看 | 乱码av午夜噜噜噜噜动漫 | 一本色道精品久久一区二区三区 | 国产午夜视频 | 男人天堂网址 | 91久久国产综合久久 | 精品福利在线视频 | 成人性生交大免费 | 国产精品视频播放 | 美女视频黄的 | 免费一区 | 亚洲精品一区二区三区在线 | 日韩在线免费视频 | 天天操伊人 | 九九九久久国产免费 | 99久久精品国产一区二区三区 | 久久久久亚洲精品 | 天天射影院 | 91av导航| 伊人久久麻豆 | 欧美日韩精品在线免费观看 | 成人av高清 | 四虎影音 | 亚洲欧美综合 | 欧美在线一区二区三区四区 | 精品视频久久久久久 | 精品久久香蕉国产线看观看亚洲 | 七七婷婷婷婷精品国产 | 99视频免费看 | 涩涩视频网站在线观看 | 精品在线一区二区三区 | 国产高潮好爽受不了了夜夜做 | 国产精品1区2区 | 91大神新作在线观看 |