Introduction
In the last chapter, you saw recipes that showed you how to use XMLHttpRequest
to make AJAX requests that exchanged JSON. In practice, handling all of the special cases in different browsers makes this a pesky, error-prone job. Fortunately, most client-side JavaScript frameworks wrap this object for you, giving you a browser-independent way to do the same thing. Often, the interface is easier to use too—as you'll soon see, in the case of AngularJS, you don't need to do anything special to move objects back and forth using JSON; the framework even takes care of serializing and deserializing the JSON for you!
Both AngularJS and jQuery are client-side JavaScript frameworks that make developing web applications easier. jQuery was one of the first and is probably the most widely adopted framework; AngularJS is newer and has the additional advantage of providing you with the ability to structure your code using the model-view-controller (MVC) paradigm.
Tip
MVC is a design pattern that...