Aliaspooryorik
ColdFusion ORM Book

Book Review: jQuery In Action

jQuery in Action is published by Manning and is available in print or as an e-book.

The introduction shows some fairly complex examples for the uninitiated to demonstrate what jQuery can do. Whilst they are interesting, to anyone new to jQuery or JavaScript in general these will probably appear rather confusing. If you're new to jQuery or not that familiar with JavaScript then you might want to skim read this section and wait until the various features are discussed later in the book.

Chapter 2 is where we start to get into the good stuff and focuses on selectors. I did notice that the attributes filter examples don't use the optional, but recommended quotes. For example (a[href*=jquery.com] can be written as a[href*="jquery.com"]), but both will work. Selectors are a core part of using jQuery and this chapter explains how to use them well and with good examples. The book is accompanied by a free download from the publisher’s website which is referred to throughout the book. The most useful part of this is the "selectors lab" that allows you to test out different selectors work on a pre-built web page. This really helps cement how selectors work as it also useful for testing your own selectors.

Chapter 2 then moves onto the basics of manipulating the DOM and chaining. There's a lot to this section and the book tries hard to go through each of the methods that jQuery has and to explain the usage. The sheer amount of information could be a bit overwhelming and I feel that maybe it would be better to concentrate on the methods that the reader is more likely to use rather than writing about all methods in one go. I guess this will depend on your existing knowledge of jQuery as to how heavy going to find this.

Chapter 3 is where you get to see how your new found knowledge can be put to use. There are some good 'real world' examples in this chapter of when and why you would want to manipulate the DOM including forms and styles. I would have liked to have seen more examples with forms as this is something I use jQuery for a lot. Having said that, if you're a designer then maybe forms aren't really going to interest you!

Chapter 4 introduces events. The chapter starts by explaining the issues of browser specific event models and talks about event bubbling. This is fairly sophisticated stuff, unless you have good experience of JavaScript, but is explained well although I suspect it may be heavy going for those who haven't used event models before. The book then moves on to how jQuery can be used to assign and remove event listeners. I think that most readers will be more concerned with knowing and understanding how jQuery can be used to handle events, rather than understanding the problems jQuery solves, however it is worth the effort of getting to grips with the event model. This chapter also mentions custom attributes. Personally I'm not a fan, but I think that the authors are right to include this technique as it can be very useful. They do also mention the pros and cons of using them.

Chapter 5 is all about animations and effects. I'm surprised that this is not introduced sooner in the book as I think that most people will probably have started using jQuery because of it's animation capabilities so this would seem like a nice familiar place to start and then introduce the more complex features of jQuery later (such as event handling). The first example in this chapter is a collapsible list which really shows off the capabilities of jQuery. If you skipped straight to this chapter when the book arrived on your doorstep then this may actually put you off as it does assume that you are familiar with jQuery, but don't be! This chapter will probably be one that you will keep coming back to, it is also the most fun and will appeal to designers and give you the tools to impress clients!.

Chapter 6 introduces the utility functions that jQuery has. These are not very exciting, but incredibly useful. For example, trimming a string in jQuery is as simple as $.trim(' my string '). The no conflict jQuery mode is also discussed which allows jQuery to work alongside other JavaScript frameworks (if you really want to). A bit more information on the $.each method would be nice as it is one that I use a lot. The coverage of $.grep and $.map are excellent and the timesaving $.unique method gets a mention. This is the chapter that will help you write better, more efficient jQuery code, so take you time and learn it.

Chapter 7 deals with plugins. Plugins are a great way to create reusable code and this chapter does a really good job of explaining what they are and how to create them. The book shows you how to create a formatDate plugin which is great because it not only demonstrates the process of writing a plugin but also gives you a plugin you can start using in your projects right away. The photomatic slideshow example is also a very demonstration of a plugin and once again is easy to see how you could apply the knowledge you will gain it your own projects.

Chapter 8 is where Ajax appears as is one of the longest in the book. This chapter starts with a fairly lengthy explanation of how to do Ajax calls without jQuery. Whilst this is interesting as I mentioned before, I'm not sure how many readers will want to know this. Yes it's cool that we can turn 19 lines of code into 1, but people bought this book to know who to do these things with jQuery rather than what jQuery saves you having to type. The chapter goes to some lengths to demonstrate the various ways that jQuery has for communicating with the server and also covers handling different data formats such as HTML, JSON & XML and trapping errors. Once you have finished this chapter you will have a comprehensive grasp of jQuery's Ajax capabilities.

Chapter 9 is about the official jQuery plugins. This chapter is the one that will suffer the most with time as more of the methods offered by these plugins become part of the core jQuery download. For example the official dimensions plugin mentioned is now included in jQuery as of version 1.2.6. The UI plugin is now a separate project available at http://ui.jquery.com/. The other plugins covered are the form and live official plugins.

The book ends with an appendix entitled "JavaScript that you need to know but might not!". This is not specific to jQuery but is an good guide to some of the concepts used in writing JavaScript including objects, object orientated and closures. Whilst you don't need to read this to use jQuery it is worth taking the time and effort.

Conclusion

8/10 - buy it!

If you want to learn jQuery then this is an excellent book although don't expect it to be a light read - you will need to concentrate to get the best from this book.

The copy I am reviewing is tested against version 1.2.1, despite this the examples are still valid and accurate. Diagrams are all in colour although I have a e-book (PDF) copy of the book and I've heard that the printed version is in black and white. The code samples are shown without any code highlighting which makes it a bit harder to read but not really a problem.

I can't think of any areas of jQuery that this book doesn't cover. My only complaints would be the history lessons and lack of a reference guide in the appendix where all the methods are listed grouped by type (although there is an index), but in fairness the book is not designed to be a reference guide and you can find this information on the jQuery website.

Where to Buy It

The Publisher's website sells the printed and PDF version

http://www.manning.com/bibeault/

Amazon (UK) printed version:

http://www.amazon.co.uk/jQuery-Action-Bear-Bibeault/dp/1933988355

Amazon (US) printed version:

http://www.amazon.com/jQuery-Action-Bear-Bibeault/dp/1933988355



5 comments

  1. Link to the book website or other place where I can buy it?

    Comment by Lola LB – August 05, 2008
  2. Hi Lola LB, I've updated the post to include links to buy it.

    Comment by John Whish – August 05, 2008
  3. Great review. I just got the second edition of this book. I downloaded the examples. Unfortunately, the selector lab loads without the test snippet. Did you have to do anything to the HTML to load the code snippet?

    Comment by Cactsbob – August 31, 2010
  4. @Cactsbob, it's a while since I looked at it, but I don't remember having any issues with it.

    Comment by John Whish – September 01, 2010
  5. @Cactsbob

    The selector lab doesn't work in chrome (but it does work in IE, haven't tested firefox).

    Comment by C – February 28, 2011

Leave a comment

If you found this post useful, interesting or just plain wrong, let me know - I like feedback :)

Please note: If you haven't commented before, then your comments will be moderated before they are displayed.

Please subscribe me to any further comments
 

Search

Wish List

Found something helpful & want to say ’thanks‘? Then visit my Amazon Wish List :)

Categories

Recent Posts