Is it better to learn ajax with javascript than jquery?

And if so,does that apply to api and json aswell?

And what other resources have you used for this except mdn and w3schools?

It doesn’t really matter so long as you avoid creating XHR objects. In terms of their interface, $.get isn’t much different from fetch. The most meaningful learning you can do regarding AJAX is to wrap your head around HTTP, CORS, and other related concepts. I suggest you start by gaining practical experience building apps (as you are now, I assume) and sticking what you know before you go figuring out what the best way to make AJAX calls is.

1 Like

So it doesn’t matter what language you use for AJAX as the concepts will be transferable.

I haven’t started making any apps with api’s yet. I’m taking a break from the ajax api json section of fcc to learn about other webdev things like git, gulp, node.js etc.

I guess if the best way to learn it is by building stuff, so I’m ganna try and find a course or youtube videos for ajax with javascript

Vanilla JS or jquery - it’s a hot debate.

I think jquery is a more gentle introduction, and is a good place to start. I think you’ll eventually want to go back and learn how to do it with vanilla JS and even using things like postman to really understand what is happening. But I think learning things in stages, hiding complexity in the beginning can be a good thing. As long as you know you will eventually go back and learn it more in depth. When people first learn chemistry, we teach them the Bohr model of the atom even though we know that it isn’t really what is happening - but they just aren’t ready for quantum mechanics. Similarly in physyics, you first learn Newton’s concept of gravity even though we know that it is flawed but “mostly” close enough in most situations - but the student isn’t ready for relativity.

If you want to delve into those complexities, go for it. But you may find getting the simpler jquery approach may be more satisfying in the beginning. There’s sooooooo much to learn in web dev that if you pedantically insist on learning everything perfectly and in depth, you’ll get paralyzed with study and never get to build anything. I think it’s better to build things and add complexity and deeper understanding when you’re ready.

1 Like

I might add that while I think jQuery is sufficient while learning the front end, once you move onto the back end, you’ll probably want to get that deeper understanding of AJAX and http as it will help as you build APIs on the backend. For me, that was what really began my deeper understanding.

Well, there’s the jQuery get() and ajax*() functions. But these are mainly front end.
There’s the native command fetch().
And there are 3rd party library like axios.


If you’re using Angular, there’s $https. Other frameworks will have similar ajax calls/methods.

Play with all of them. :slight_smile:

Dealing with XHR request in vanilla JS is hell, but it does teach you a bit about how JS handles requests. You will rarely use vanilla XHR because stuff like fetch, Axios and jQuery exist.

Correct. AJAX is a technology pattern, a way of getting data from a server. It doesn’t matter if you are using vanilla JS, jQuery, or React. That said, there are subtleties for each method. If you are using the XHR method, you will have to know and do a lot more than if you just use jQuery or fetch.

I don’t think that’s a good idea. If you don’t know how to call an api from the front-end you have zero business making one with Node.js and gulp. Git is a good thing to know at any level, but I would definitely learn how to use api’s before I go playing around with Node.js and Gulp. You should at least do the Wikipedia, Twitch, and Weather apps.

This one helped me.

1 Like