Preface to the Second Edition

It’s been two years since the first edition of jQuery in Action was published. Was it really necessary to update the book so soon?


Compared to the steady world of server-side languages such as Java, the client-side technologies of the web move at a mighty fast clip. And jQuery isn’t eating anyone’s dust; rather, it’s at the forefront of the rush!

The jQuery team releases a major new version of the library just about every year (lately, striving for every January), in addition to the minor updates that are made throughout the calendar year. That means that there have been numerous minor releases, and two major versions since the publication of the first edition, which was written against jQuery 1.2. And what updates jQuery 1.3 and jQuery 1.4 have been!

With each major release, the capabilities of jQuery have been extended and enhanced in significant ways. Whether it be the addition of custom events, event namespaces, function and effect queuing, or simply the large handful of really useful methods and functions that have been added, the range of capabilities that jQuery spans has increased significantly since the first edition hit the stands.

And that doesn’t even consider jQuery UI! In its nascent stages two years ago, jQuery UI merited a few sections in one chapter of the first edition. Since then, jQuery UI has grown in scope and maturity and warrants a complete book part in this edition, consisting of three full chapters.

So it should come as no surprise that this second edition has made its way onto the shelves covering the advances that jQuery and jQuery UI have made over the past two years.

What’s new in the second edition?

When we decided to go ahead with creating a second edition of jQuery in Action, I remember someone saying to me, “Should be a piece of cake. After all, you just need to make some updates to the first edition.”

How wrong they were! It actually took longer to complete this second edition than to write the book in the first place. You see, we didn’t want to fall into the trap of “phoning it in” by just adding updates here and there and calling it done. We wanted this second edition to be much more than a warmed over version of the first edition.

Anyone comparing the table of contents of the first and second editions of this book will note that the structure of chapters 1 through 8 hasn’t changed all that much. But that’s pretty much where the similarities stop.

This second edition isn’t just a tepid rehash of the first edition with some extra information sprinkled here and there. Each and every paragraph in the text, and each and every line in the example code, has undergone a careful inspection. Not only have the additions and changes made to jQuery between versions 1.2 and 1.4 been taken into account, the information in the chapters and the example code have been updated to reflect current best practices regarding page scripting and the use of jQuery. After all, as a community, we’ve got two more years of experience writing highly interactive scripted pages using jQuery under our belts.

Every example has been examined and either updated to better show how to use jQuery 1.4 in practice, or replaced with an example that is better suited to showcasing the concepts being discussed. For example, readers of the first edition may remember the comprehensive Bamboo Grille example at the end of chapter 4 that highlighted jQuery event handling. Try as we might, we were unable to reshape that example to flaunt the newest jQuery event handling concepts, such as “live” and custom events. So it has been completely replaced with the DVD Ambassador example that serves as a better vehicle for demonstrating the advanced event-handling concepts.

The second part of the book, focusing on jQuery UI, is completely new material, covering the extensive changes that jQuery UI has undergone since the first edition was published.

We’d estimate that, counting the additions, replacements, and updates of the material presented throughout the first part of the book, as well as the completely new content of part 2, that at least 50 percent of this second edition is brand new material. The other 50 percent has undergone extensive rework to ensure that it is up to date and reflective of modern best practices.

So much for the “piece of cake”!