Skip to content

Commit

Permalink
Update fetch() vs jQuery.ajax() list intro in “Using Fetch” (#3416)
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesnw authored Mar 23, 2021
1 parent 6df605f commit 7061db9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion files/en-us/web/api/fetch_api/using_fetch/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<p>This kind of functionality was previously achieved using {{domxref("XMLHttpRequest")}}. Fetch provides a better alternative that can be easily used by other technologies such as {{domxref("Service_Worker_API", "Service Workers")}}. Fetch also provides a single logical place to define other HTTP-related concepts such as CORS and extensions to HTTP.</p>

<p>The <code>fetch</code> specification differs from <code>jQuery.ajax()</code> in three main ways:</p>
<p>The <code>fetch</code> specification differs from <code>jQuery.ajax()</code> in the following significant ways:</p>

<ul>
<li>The Promise returned from <code>fetch()</code> <strong>won’t reject on HTTP error status</strong> even if the response is an HTTP 404 or 500. Instead, it will resolve normally (with <code>ok</code> status set to false), and it will only reject on network failure or if anything prevented the request from completing.</li>
Expand Down

0 comments on commit 7061db9

Please sign in to comment.