jQuery Fundamentals

**** Oct202011

I’ve reviewed several books on JQuery already, but I realized I’d discovered most through an Amazon search. One of my favorites though, jQuery Enlightenment by Cody Lindley, is not sold through the world’s online bookstore, so I wondered if there were others I had missed. Indeed, the second listing in Google’s search results for “JQuery book” is JQuery Fundamentals, an excellent resource on javascript and jQuery, and a novel sort of book altogether.

jQuery Fundamentals was written by Rebecca Murphey with contributions from others. According to a blog post by the author, she has since moved away from jQuery to the Dojo library, but there are plans for the book’s content to become an official learning resource managed by the jQuery community. [Full disclosure: I was fortunate enough to meet with two developers involved in the jQuery project at the recent jQuery Conference in Boston, and volunteered to help out with this].

Writing Javascript, jQuery, and better jQuery

Part I is a whirlwind tour of Javascript basics, from basic operators to the concept of closures in record time. Though it is rapid-fire, the code snippets are apt, well-explained, and thoroughly commented, so someone taking their time with the examples should be able to pick up the concepts.

Still proceeding at a rapid clip, Part II begins the basics of jQuery: getting elements, setting attributes, traversing the DOM, and manipulating elements. One great strength of this book is the exercises which are provided to solidify each concept. For example (given some existing html):

2. Come up with three selectors that you could use to get the third item in the #myList unordered list. Which is the best to use? Why?

Throughout the book, the exercises are appropriate to the level of knowledge, but are tasks a developer might easily encounter in the real world.

The remainder of Part II covers Events, Effects, and Ajax. It also goes a bit beyond what I would consider basic, into using and writing plugins.

After the reader has soaked in Parts I and II and worked through the exercises, Part III provides some best practices for writing clean, speedy jQuery code.

Possible improvements for beginners

A few concepts could be explained in greater depth for the benefit of beginners, such as how to set up a testing environment for working through the examples (some screenshots or even video of working in Firebug or Chrome dev tools would be handy). Also, some constructs that may be familiar to experienced coders but are mystifying to beginners could be explained in more detail. The simple structure:

	//do stuff

puzzled me for quite a while when I firest encountered jQuery (I remember thinking: “What is that dollar sign, exactly?”).

The very last portion of jQuery Fundamentals covers RequireJS. This seems beyond the scope of “fundamentals” and might be better moved into a separate resource. For someone just learning jQuery, the next thing they need is probably not a way to manage a web app with 12 different jQuery modules. More likely, they’ll need debugging help: where to start, building minimal test cases, and common gotchas (though some are mentioned throughout the book). Even an exercise or two set up just for the purpose of practicing debugging could be very useful.

jQuery Fundamentals as a model for coding books to come

After stumbling across this book, I wondered: Why do I still insist on buying printed books on topics so rapidly changing as jQuery and CSS that they’ll likely be a bit outdated a year from now? I settled on two main reasons:

  1. They have a direction. When it comes to code, this generally means they start simple and layer on complexity through the end. Even the best online documentation is usually a reference, not a guided tour.
  2. They tell you things you didn’t know you didn’t know. If you’ll forgive a Donald Rumsfeld quote:

    There are known unknowns…But there are also unknown unknowns. There are things we do not know we don’t know.

    The results of a Google search or a dive into online docs usually give you information you were looking for (about known unknowns), but a book can provide you with useful information you weren’t looking for (those pesky unknown unknowns).

Of course, online documentation, wikis, and blogs have their advantages too: It’s easy to make changes to keep them current or correct errors; they can be improved through feedback from readers; and linking to other useful resources is built in.

JQuery fundamentals is a marriage of these two: A book that has a direction and reveals unknown unknowns, but that can be a collaborative effort and a respond rapidly. To boot, it’s a well-presented introduction to javascript and jQuery.

Respond to this review

Author(s)Rebecca Murphey, et al.

No comments yet…Be the first!

Comments are closed for this article.