Learning jQuery (Third Edition) by Jonathan Chaffer and Karl Swedberg

by Peter

jQuery has become a familiar term over just a very few years. It refers to a free, open-source multi-browser JavaScript language developed by John Resig (who has actually written the foreword) and released in the beginning of 2006. The purpose of the library was to make client-side scripting of HTML easier. Using jQuery instead of standard JavaScript, developers would be able to write code that rendered exactly as it should in all the browsers without the use of «hacks» or, indeed, without even needing to know about the peculiarities of individual browsers.

jQuery has delivered on its promise. It has made it much easier to do DOM scripting, develop AJAX applications and also build a library of reusable plugins. Also, it is widely used in building mobile web sites. Today jQuery is used on a majority of the 10K most visited websites and has become very popular for its compact code and relative ease of use. Currently there is no other JavaScript library as popular as jQuery!

Learning jQuery Chaffer and SwedbergLearning jQuery is an introduction to this powerful tool written by two developers who are well known in the jQuery community, Jonathan Chaffer and Karl Swedberg. This is the third edition of «Learning jQuery», and is aptly subtitled «Create better interaction, design, and web development with simple JavaScript techniques».

Learning jQuery is very solid and an excellent introduction to jQuery. The book is well organized and progresses in an interesting and relatively natural fashion. The first five chapters cover the basics: getting started, selecting elements, handling events, styling and animating, and manipulating the DOM. While introducing readers to these topics, the authors introduce various methods – often several alternative ones – that can be used to achieve desired results in a very nice progression. Then, in chapter 6, the book deals with the basics of using AJAX.

The mid-section of the book first introduces jQuery plugins: Where to find them, how to use them, and so on. And it also contains a chapter on building plugins which actually can be quite useful to browse even if you don’t think you will ever be doing that, as it makes you understand the logic underlying them.

At this point Learning jQuery takes an interesting turn: In the following chapters it returns to materials covered in the initial chapters with added depth. So the final five chapters deal with advanced selectors, advanced events and so on. To me, this is a very nice way to do it. As a beginner, you may not be able to move on to these chapters immediately, but as you start doing things with jQuery and learn a little more, you can return and dig deeper at your own pace and on the topic of your choice.

To my mind, Chaffer & Swedberg’s Learning jQuery is most likely the best beginning jQuery book to date. It is in many ways excellent. But perfect it is not. More could definitely be done to make the discussions more pedagogical and improve the assignments. Also, sometimes the authors «jump the gun» and introduce fairly advanced code without explaining it (for instance, on p. 59 a new smart variable is suddenly introduced which is not discussed: where does

«var bodyClass = this.id.split(-)[1];»

come from, and what do the various parts of the definition mean? There are unfortunately several like this one.). So a little more patience and a little more attention to the “learning” part of the mission as opposed to the jQuery one, would probably pay dividends even at this point.

That said, these are relatively minor flaws. Learning jQuery by Chaffer & Swedberg is an excellent choice for anyone wanting or needing to learn jQuery. It’s a good book for learning the basics, and an excellent book to return to after a while to learn even more!

Related Posts:

Leave a Comment