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

                          主站蜘蛛池模板: 国产区在线 | 一区二区三区在线免费观看 | 视频三区 | 99久久婷婷| 欧美成人a∨高清免费观看 欧美日韩中 | 国产乱码精品一品二品 | 亚洲视频一区在线观看 | 一级做a毛片 | 亚洲国产91 | 久久aⅴ乱码一区二区三区 亚洲欧美综合精品另类天天更新 | 国产传媒毛片精品视频第一次 | 日韩欧美精品一区 | 亚洲一区不卡在线 | 台湾佬久久| 日本淫视频| 欧州一区二区三区 | 亚洲欧美少妇 | 福利视频三区 | 91av在线视频观看 | 久久久精品一区 | 久久综合av | 日日干日日 | 国产高清在线观看 | 中文字幕亚洲区一区二 | 黄色免费观看网站 | 欧美影院 | 国产日韩欧美二区 | 欧美 日韩 国产 成人 | av资源中文在线天堂 | 鲁视频| 91精品国产麻豆 | 欧美精品一区免费 | 国产精品免费一区二区三区四区 | 一区二区三区中文字幕 | 日韩精品一区二区三区中文在线 | 激情国产| 国产资源一区二区三区 | 午夜精品一区 | 国产资源视频 | 青青草久久 | 精品亚洲一区二区三区四区五区 |