jQuery in Action

Title: jQuery in Action
Author: Bear Bibeault & Yehuda Katz
Year: 2008 (Old Edition)
For: For developers who want to maximize their usage of jQuery.

From co-authors Bear Bibeault (co-author of Secrets of a JavaScript Ninja, an excellent book co-written by jQuery founder John Resig) and Yehuda Katz (head of the jQuery plugin development team), jQuery in Action is a dense, comprehensive overview of the jQuery API that goes into great depth on core jQuery, some popular plugins, and authoring your own plugins. While new JavaScript frameworks are doing a lot of heavy lifting that was once the exclusive domain of jQuery, jQuery remains integral for many reasons and this book will teach you, sometimes in grueling detail, every detail of the core jQuery API.

First a little aside: I read an old edition of the book because that’s what my library had. It was written in 2008, one year before ES5 was standardized, and has since been rereleased in the 2015 edition. It was also a misprint and came with two chapter 4s, 5s, and 6s; a fun surprise when lumbering through this book.

The Content

I liked this book. I learned a lot not just about jQuery, but about library best practices (in the section about authoring plugins, special attention is given to preventing namespace pollution). However this was a very long read that I ultimately had to check out three times to finish (not unlike Secrets of a JavaScript Ninja). The authors start with an explanation on the importance of jQuery, dive into a chapter on advanced jQuery selectors, and then go through each and every aspect of the library. Whenever a new function is encountered, seemingly every page, a table explaining every option and usage is offered for that function. Each chapter tends to follow a usage case with the JS being refactored with each new function to show off jQuery’s knack for shortening code.

Past the initial history lesson and selector overview, the chapters each address a set of related jQuery methods in this order: changing element properties and content, the jQuery event model, animation and effects, jQuery utilities, and jQuery’s Ajax control. Also included is a chapter on authoring plugins and a chapter on popular plugins (Form, Dimensions, Live Query, and UI). In my opinion, the most useful of these were the selectors and Ajax chapters as they were informative beyond the usage of jQuery and alone make the book worth flipping through.

The Style

The book is very, very dry despite the authors trying to spice it up with the occasional funny aside. There’s really not any opportunities provided to code along with a project and this makes the book read more like a reference manual. However there are regular “Labs” that the authors have made available as downloads (and online) that allow the reader to test out various functions; similar functions are usually bundled together in a single lab to compare their effectiveness.

This book is difficult to go through straight and should probably only be approached casually with a specific problem to solve. My biggest complaint in regards to the format of this book (besides the misprint) is that every page seems to have a function breakdown or an options table or a diagram or a lab or an aside. These distractions would be better placed as footnotes or as an appendix so as to permit a distraction-less reading experience.

Summary

Despite my complaining, I’m really glad I read this book. I feel more comfortable than ever with jQuery and have already started writing code that minimizes global variables, reduces naming collisions, and uses tricks that jQuery authors suggest for best-practice JavaScripting. Would I recommend trying to read this in a weekend? No, absolutely not, but it’s a great book to flip through or even keep nearby. Plus it has a foreword by John Resig, and who doesn’t want to hear what that guy has to say?

Return Home