javascript
javascript copied to clipboard
Use fetch over $.ajax
While good, hardly any browser supports this except everything thats greenfield. IMO its clearer that it stay as $.ajax
since most are at least familiar with jQuery AJAX calls, even if they don't use them.
hardly any browser
73% usage relative...
73% usage relative...
That may be the case for browsers, but fetch
is uncommon in most client code. There are notable disadvantages to using fetch
and I would wager that most developers have not used fetch
in production.
The guide is meant to be clear and instructive, as opposed to forcing developers to research the fetch API.
https://medium.com/@thejasonfile/fetch-vs-axios-js-for-making-http-requests-2b261cdd3af5
(separately, fetch
isn't really meant to be used directly; it's a low-level primitive for libraries to abstract over)