Your welcome!

The thing is, jQuery is a JavaScript library which is invented in the time when JavaScript was a headache. Doing a AJAX request with XHR was not fun.

I don't know what jQuery is doing under the hood right now, but it seems they are using XMLHttpRequest under the hood for `jQuery.ajax()`.

The Fetch API is a newer version of the old XMLHttpRequest. It works better because it's build with Promises why are nice to work with than events.

I hope that this makes it clear for you 😉

Written by

I write stories about Frontend Dev, JavaScript, Typescript, Angular, NodeJS, Serverless Functions, JAM Stack, FaunaDB, Netlify, Apple, iOS— https://byrayray.dev

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store