Thanks. Can I just plug-in Axios instead of ajax and I am just good to go if I am using plain Javascript? The link yo mentioned is requiring npm I think.
Sorry about the confusion. I was wondering if I would have to download npm to use Axios in my code. But if a CDN link is available just like a jQuery then I could just include that and start using Axios in my code, right? Thanks for your inputs.
You’re getting your terminology slightly confused.
Ajax is a method of exchanging data with a server, and updating parts of a web page – without reloading the entire page.
jQuery is a JavaScript library. It has an $.ajax() function, which you can use for the above purpose.
So I guess the sentence should read “I should probably switch to this then and stop using jQuery.”
And the answer to that is fully, it dependsTM.
If you are using jQuery elsewhere on your site and you are happy with it, then there is no need to abandon it. I would not recommend adding Axios as an extra dependency for the sake of it.
However, if you are only using jQuery to make Ajax requests, then axios might be a good fit for you. It has a smaller footprint and (IMO) a nicer API.