I wanted to pick up a book on jQuery for quite some time now so I decided to give jQuery in Action a try. Besides all the nice things I’ve heard and read about jQuery, I didn’t have a clue about any of its capabilities. This book got me up to speed fairly quickly, but I reckon this is also partly due to the flat learning curve inherent to jQuery. After reading through the first three chapters I’ve come to realize how amazingly powerful this JavaScript library really is.
I can now see why jQuery (re-)popularized the JavaScript programming language. I got quickly overwhelmed by how well thought-out the API is and how it consistently shields you from having to deal with browser-specific issues. Its simplicity, conciseness and small footprint makes it an essential tool for rapid web development.
Back to the book itself now :-).
The book consists of two major parts. The first part is devoted to the jQuery core library consisting of eight chapters and the second part deals with jQuery UI which exists of three chapters.
The first chapter provides an introduction to jQuery, an explanation about the concept of unobtrusive JavaScript (which is a very important principle carried forward by the library) as well as an high-level overview of the features and capabilities of jQuery.
The second chapter facilitates an in-depth discussion of the popularized jQuery selectors, generating HTML and various ways on how to manage the wrapped element set. The authors did a great job providing a thorough and complete description of all the CSS and custom jQuery selectors. This chapter alone is worthy enough for buying the book.
The third chapter shows how to manipulate element properties and attributes, changing CSS styles and operating on HTML content.
The fourth chapter is dedicated to events, describing how to bind or remove event handlers using jQuery without having to deal with the different browser event models. This chapter concludes with a nice example that puts all the knowledge of the previous chapters into practice.
The fifth chapter is all about showing or hiding elements using effects and animations. The part on queuing functions and how jQuery provides support for this is really fascinating.
The sixth chapter provides an explanation for a whole bunch of jQuery utility functions, among which are functions for trimming strings, performing operations on JavaScript arrays and extending objects, etc. …
The seventh chapter is one I skipped. It talks about how to extend jQuery.
The eight and final chapter of the first part of the book is about Ajax. It shows all the high-level and more low-level features that are provided by jQuery for making Ajax requests. This chapter again provides a thorough view on these capabilities which I also used as a reference a couple of times already.
I skipped reading the second part of the book which I’ll probably reference later when I’m going to need themes, UI effects, UI widgets, mouse interactions, etc. … . The most important thing for me was to learn about the jQuery core library.
I really liked the labs and exercises that are spread throughout the book. Those were very helpful to play around with a particular part of the jQuery API. All the chapters and topics were very thorough and complete. You can both learn jQuery from this book as well as use it as a reference for later, although I personally have the feeling that its a tiny bit more of a reference book than a learning book. The downside of these kind of books is that they become out-of-date really soon. Something I would really love to see in a future edition of the book is a chapter on best practices (or contexts), pitfalls and lessons learned with using jQuery. For example, some parts of the jQuery API can have a significant impact on performance (like calling appendTo() in a loop) while there are some specific solutions that are a lot faster.
This book opened the gates to the world of jQuery for me and it encouraged me to learn and exercise the jQuery coolness. I really enjoyed the learning experience.