Part 3. Advanced topics
In part 2 of this book we introduced you to an incredible number of jQuery selectors, methods, and utility functions. If you’ve mastered them, with a bit of time and a pinch of patience, you’re now able to create every feature you want. In the last chapter, we proved to you that this is true and that with enough knowledge, the only limit is your imagination.
Although jQuery is powerful, it doesn’t have a method or a function for everything your projects may require. To fill this gap jQuery has been built to be easily extensible, allowing web developers to include their functionalities as if they were part of the jQuery core. In the next chapters you’ll learn how to create plugins for jQuery. Then we’ll discuss the Deferred object and its methods. The Deferred object belongs to the jQuery core, but we’ve chosen to treat it separately because it’s not easy to digest.
Unless you’re developing a very small project—something that only you will use—you’ll write code that needs to be refactored, updated, and changed in some way. For such situations you want to be sure that all the code that used to work before the changes won’t break after the updates. A way to ensure this is to test your project. Because we’re talking about testing, why not adopt the same solid unit-testing framework, called QUnit, that has been developed by the jQuery team and employed to test the jQuery library? It sounds pretty reasonable, doesn’t it? This is what we’ll do in chapter 14.