Slashdot Mirror


Learning jQuery

hal10001 writes "One complaint of just about any book that attempts to teach a new language or technology is a presumed level of expertise by the authors. I found it refreshing that in Learning jQuery the book begins... well, at the beginning, and increases in difficulty along with the concepts. It gives designers and entry-level interface developers the opportunity to come up to speed at an acceptable pace."Read below for the rest of Brian's thoughts on the book. Learning jQuery author Jonathan Chaffer, Karl Swedberg pages 352 publisher Packt Publishing rating 8/10 reviewer Brian Reindel ISBN 978-1-847192-50-9 summary Better Interaction Design and Web Development with Simple JavaScript Techniques While I consider the screenshots to be lacking in quality, overall, this book will definitely leave you satisfied. The essentials required to be successful at developing with jQuery are all touched upon, and the depth of explanation for each piece of code is precise and clear. You will not find yourself flipping through chapters of fluff, added only to beef up the number of pages. Each tutorial and example is carefully planned and executed.

Describing concepts in relation to any JavaScript library can be difficult. Since libraries are in fact JavaScript, it can be easy to confuse beginners. The authors are careful not to allow this to happen. This is especially apparent in Chapter 3, when highlighting the event model, event capturing and event bubbling. A clear distinction is made between browser implementations and the unique facets of jQuery. Official documentation is often wanting in these areas, and the book fills in the gaps nicely.

Throughout Learning jQuery, additional notation is included to subtly remind developers of any potential gotchas, which is a nice feature. For instance, while referencing the clone() method, it was noted that only elements of the DOM are copied, and not the events previously associated with those elements. These tips are always appreciated, since in a development environment they can prevent hours of head-scratching, and help eliminate frustration.

I was also impressed that the authors cover both JSON and XML as data-interchange formats in Chapter 6, AJAX-How to Make Your Site Buzzword-Compliant. This illustrates conformity not to a single standard, but to real-world development scenarios, where you might encounter both formats. My only complaint here is that not enough time was spent specifically on jQuery's $.ajax() method for AJAX implementations, since in my experience this tends to be more popular than the $.get() method.

The only change I would make to the format of the book would be to divide it into two parts. It is obvious that the authors intended to begin with jQuery key concepts, and then move into cookbook mode. This does happen after Chapter 6, but it would have been helpful to make that distinction more evident. If you do buy the book, be aware that in order to digest these great tutorials, that you should dedicate more time for the latter half of the book.

Finally, I would like to add that although this book does not cover jQuery v.1.2, or the UI plugin, it is still worth the purchase. If you use the latest version of jQuery, and still want to implement the same XPath selectors covered in the book, you just need to download a plugin. You will not find a better resource online for getting into the guts of the jQuery JavaScript library than you will offline reading the book Learning jQuery.

You can purchase Learning jQuery from amazon.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.

10 of 85 comments (clear)

  1. what is jquery? by stoolpigeon · · Score: 4, Informative

    somebody is gonna ask.
     
      jquery This seems like a good place to start.

    --
    It's hard to believe that's how Micronians are made. Why don't we see it right now by having you both kiss one another?
    1. Re:what is jquery? by Bogtha · · Score: 2, Informative

      Mootools is simply faster, smaller, and more modular (read: well written) than the competition.

      Faster, smaller and more modular? Firstly, if you are worrying about the speed at which your JavaScript executes, you are almost certainly either prematurely optimising or using way too much JavaScript. Only a minority of developers need to worry about that, even assuming older clients. Having said that, the release notes for jQuery 1.1.3 have some interesting notes regarding the benchmark you refer to:

      • We're over 800% faster than we were in jQuery 1.1.2.
      • We're the fastest framework in the most popular browser, Internet Explorer 6.
      • We're the only framework that doesn't give incorrect results.

      As for smaller, well jQuery is 26kb after packing, and the link you provide says that mootools is 34kb after packing, so I don't see how your link backs you up there.

      As for more modular and well written, in what sense do you mean this? I skimmed over the website, and was struck at how mootools' site itself abuses JavaScript (major annoyance: don't use <div> s and JavaScript to badly emulate links when a real <a> element would do). I find it hard to believe that a project that makes basic mistakes like that would be well written, but if you would care to go into detail perhaps I might change my mind.

      --
      Bogtha Bogtha Bogtha
    2. Re:what is jquery? by Bogtha · · Score: 1, Informative

      No, it's not Yet Another Language. It's a JavaScript library, and it's quite easy to have 5+ years experience with JavaScript.

      --
      Bogtha Bogtha Bogtha
  2. Competition on the way by Anonymous Coward · · Score: 1, Informative

    At the moment this is the only introduction to jQuery, but in a couple of months Manning will release jQuery in Action . It is a pity that the writer of this review didn't wait until both were available to tell which is the better.

  3. Re:Poor Choice of Name by linuxbz · · Score: 1, Informative

    And why, exactly, should Java own every library that begins with the letter "j" ? Is Java the only programming language that starts with "J" ? Well, no, there's ... well ... JavaScript. Now, you could easily argue that JavaScript is a poor name since it has little or nothing to do with Java, but if you say everything that starts with "x" must relate to X-windowing, everything starting with "g" must relate to Gnome, k* must be KDE, w* must be Windows, etc., it seems that we'll run out of meaningful library names before long.

  4. oldie but a goodie by tehwebguy · · Score: 4, Informative

    This site doesn't seem to be updated in a few versions, but it's still very applicable:
    http://www.visualjquery.com/

    --
    -- lol pwned
  5. AJAX Frameworks by dannydawg5 · · Score: 5, Informative

    As a web developer, I get asked quite a bit about AJAX frameworks/code libraries. I have nothing but praise for jQuery. Here's my take on some of the major players:

    1. YUI has been object-oriented to the point of uselessness. Everything requires YAHOO.blah.blah.blah(YAHOO.EventUtil.blah.blah.blah), and then they want you to have another line with YAHOO.AddListener.blah.blah(yourFunction) to add it to the execution list. I like objects. Wait, let me clarify, I like MY objects! I stopped doing what they asked and starting writing wrapper functions to their functions.

    2. GWT requires a zillion steps. I spent half a day installing a Java IDE and compiler and running example projects to see how to use it. Perhaps this is useful for massive projects like Gmail, but for the rest of us who are just looking to add a few effects, instead of writing Java to generate JavaScript, you are better off just writing the JavaScript directly.

    3. The Scriptaculous documentation seemed nonexistent. I was trying to find meaty documentation, and every page was essentially "LOOK WHAT I CAN DO!1!11"

    In short:

    1. YUI has a zillion files and still leaves you writing tedious DOM and your HTML ugly. They DO have some good stuff, which I will get to later.

    2. GWT is like installing MS Word when you all needed was a good text editor.

    3. Scriptaculous will leave you hanging.

    (Side Note: I was just learning DOM when I tried out Scriptaculous. The bad taste may be the learning curve all beginner's must go through).

    My recommendation:

    -Go with jQuery + YUI's "reset-fonts-grids.css" file.

    That YUI css file will reset all the browser defaults to an even layout saving you tons cross-browser tweaking. (Some things I disagree with though, like no bullets or numbers on your UL and OL tags. Still worth it though.) YUI Grids also has some nice templates to help you with div-based layouts. They have a few added extras too beyond just JavaScript code libraries.

    jQuery is simply the most elegant and concise JavaScript library I've found. The idea behind it, "find this, and then do that", is great. The code looks simple, and your HTML code is left clean! People have developed modules for it too, so I may can replace my YUI added extras and just worry about 1 code library.

    Hope that helps someone,
    Dan

    1. Re:AJAX Frameworks by j_d · · Score: 1, Informative

      scriptaculous' documentation is a goddamn joke, which is particularly embarrassing since its parent lib, Prototype, has a pretty well-organized and straightforward site.

    2. Re:AJAX Frameworks by hal10001 · · Score: 3, Informative

      Hi vurg, You will find that Prototype is a bit more verbose than jQuery, and that DOM manipulation is more complicated. However, if you're just using it for effects, then I suggest you take a good look at both, since Scriptaculous (built on top of Prototype) is very well received, while jQuery's UI plug-in is fairly new.

  6. Perhaps some way of "querying" the document? by weston · · Score: 2, Informative

    I feel that DOM should be tossed and replaced with a relational equivalent

    You mean some sort of method of accessing it via flexible symbolic queries describing attributes and relationships between nodes? One that retrieved arrays of matching results?

    If only someone had invented such a thing. ;)

    (To be fair, most of the other libraries have something similar as well.)