Is it better to learn how to code AJAX without the use of an AJAX library? What are the advantages of coding from scratch over using a library such as jQuery?
What are some of the pros and cons of using jQuery?
For learning, yes, avoid libraries. Especially for something as conceptually simple as AJAX, forcing yourself to learn how the browser can be used "raw" will benefit you immensely later on, even if you are using a library to take care of the drudgery and abstract away browser differences.
Once you have a solid understanding of how it works though, use a library, if for no other reason than spending time working around subtle browser differences is a waste. Better yet though, spending some time reading through the source of jQuery and others will give you insight into what well-written JavaScript looks like - and that in turn will benefit the code you do write!
While I think it is really important to understand conceptually what is going on and be able to correctly implement calls using an AJAX library, I disagree with @Shog9 that you need to write the actual code to perform an XmlHttpRequest in order to start using AJAX. I'd say do some background reading to understand the concepts -- implement the code samples demonstrating them if you want -- but once you get the concept, find some tutorials on how to do stuff with AJAX with or without libraries. You'll soon find that others have been there before and left pretty good sign-posts on how to get around.
I agree with the sentiment about looking at framework code to see how to write good code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With