Book Review: Learning jQuery 1.3

In a brief span of four years, jQuery has become one of the most popular JavaScript Frameworks. Among the many websites & organizations that have adopted it is Microsoft and we are going to see a lot more of jQuery being used in ASP.NET websites than earlier. I've been using jQuery on & off for more than a year now. I more than agree with jQuery's motto that you will start writing less code & doing more with this nifty JavaScript Framework. What's more, it's all cross-browser code!

The book Learning jQuery 1.3 is written by Jonathan Chaffer and Karl Swedberg. Both are members of the core jQuery team and John Resig, the creator of jQuery speaks glowingly about them in the foreword of the book. This book builds on the earlier edition which was one of the first books on jQuery. I've benefited from reading this book & recommend it to everyone working or starting to work with jQuery.

This book is a comprehensive guide for beginners & a handy reference for experienced developers. Web developers & designers with a fair knowledge of HTML, CSS & JavaScript can sink their teeth into this 400+ paged book & start coding in jQuery confidently after finishing the book.  Spread across 11 chapters, the book covers the basics of jQuery in the introductory chapters, goes progressively into complex topics and concludes with a chapter on developing your own Plug-ins. Like I keep doing, you will probably refer to the Appendices multiple times. The code is download-able from the book's homepage. There are a lot of tips, tricks & best practices in the book and learning about them is sure to make you the jQuery expert at office. Sample this -
..when we plan to use a jQuery object more than once, it's generally  a good idea to cache the selector by storing the resulting jQuery object in a variable as well.

Written in plain-English, the style is conversational & friendly. The book has numerous practical examples (like those for implementing pull quotes, headline rotator, image carousel, table sorting, filtering & pagination) that can be directly used at work. While elaborately explaining how a particular client-side feature can be built, the authors show where something could go wrong and this helps in understanding a concept better.

The authors provide sufficient background & context while getting into topics that may be intimidating to beginners. For instance, this explanation of the hide() and show() methods impressed me -
The .hide() method sets the inline style attribute of the matched set of elements to display:none. The smart part here is that it remembers the value of the display property—typically block or inline—before it was changed to none. Conversely, the .show() method restores the matched set of elements to whatever visible display property they had before display:none was applied.

One place where I remember missing the background though was in a snippet that used the rel attribute. I learnt from W3Schools that the rel attribute of the anchor tag is not really supported by any major browsers and it can take over a dozen possible values. This is a minor detail though & I'm probably nit-picking.

I wish the key features of jQuery 1.3 as well as critical differences from the older versions were highlighted. While it's no doubt good to use the latest version of jQuery, it would have been beneficial to those who have already used older versions to know how breaking changes can impact their code. For example, some folks may miss the fact that if you upgrade jQuery from 1.2 to 1.3, you also have to upgrade the jQuery UI Plugin suite that they may also be using from version 1.6 to 1.7. At a minimum, the Quick Reference at the end of the book could have briefly mentioned when something not in the original jQuery API was introduced or modified. I'm glad however that there is a Quick Reference as I had wished for while reading the first edition.

There is a sample chapter available online(PDF) that you can check to see if the book suits your tastes.

This review is based on the ebook version that I received from a PacktPub representative.

Also see:
My favorite jQuery plugins
180

Comments