AdvancED DOM Scripting (Book review)

I have read many blog posts and several books that try to explain some of the JavaScript concepts that many have a hard time with, like scope, closures, and object oriented programming. I’ll openly admit that I was still struggling to really wrap my head around closures, for instance.

Well, after reading AdvancED DOM Scripting I think I finally get it. I guess it’s either because I have accumulated enough DOM scripting knowledge to make things ‘click’, or it’s simply because the book’s main author, Jeffrey Sambells, manages to explain these concepts in a very understandable way.

The first chapter of the book is titled “Do It Right with Best Practices”, and you’re right if you’re guessing that I love that approach. Teaching best practices should be the main goal of any book on web development, and Jeffrey (and his co-author Aaron Gustafson) keeps best practices in mind throughout the book.

AdvancED DOM Scripting consists of three main parts:

  • DOM scripting in detail covers best practices, closures, objects, the DOM, events and event handling, and how to control and modify CSS with JavaScript.
  • Communicating outside the browser is where using Ajax to communicate with the server is explained.
  • Some great source takes the reader into the world of JavaScript libraries, visual effects and mashups.

Each part is concluded with a case study that makes use of much of what has been explained in the previous chapters.

I think this is a very enjoyable book to read, much thanks to the authors’ writing style. Both Jeffrey and Aaron take care to explain how the techniques they use work and most importantly why. AdvancED DOM Scripting also encourages the reader to follow along by building their own JavaScript library of functions that make manipulating and interacting with the DOM easier. Hands-on practice really helps understanding, so that is an excellent approach.

The nitpicks I have are that I think the book could have used one more round of proofreading. While reading the book I managed to spot a number of typos, some of them potentially confusing. Also, there is a case study that walks you through building a photo cropping and resizing tool, where the example HTML code does not follow best practices. It’s probably a simple oversight, but it’s a bit ironic to find in a book that wants to teach how to do things the right way.

That said, I would still highly recommend AdvancED DOM Scripting to anyone with a medium to advanced level of JavaScript knowledge looking to learn more about modern DOM scripting.

AdvancED DOM Scripting
Authors: Jeffrey Sambells, Aaron Gustafson
ISBN-10: 1590598563
ISBN-13: 978-1590598566

Posted on November 29, 2007 in JavaScript, Reviews

Comments

  1. November 29, 2007 by Brian F

    Sounds like exactly what I need to take it to the next level. Thanks for the heads up!

  2. Thanks for the review, Roger.

    I think I see that more and more in ‘specialized’ books - books geared to one main topic (JavaScript, CSS, HTML). They teach best practices for their specific arena - then when they integrate it with another aspect, they don’t always practice best practices.

    I think this is both good and bad. For those that are specialized, they REALLY know their stuff and can really teach you things (as this book did for you). BUT, sometimes they are so specialized that they don’t really know best practices of other areas (CSS, HTML, etc).

    So, while I understand the frustration, I think a little context of the author and the goals come into play. Does that make sense? I know not everyone is a jack of all trades, so I guess we have to weigh that in while reading things.

    What are your thoughts? I only ask because there are other books that do the same thing. Programming books can teach excellent programming techniques, and then show really poor HTML practices.

  3. Thanks for the great review!

    I’ll have to go back and take a look at the markup for the image cropping example. I do try to stick to best practices in all aspects of my work including DOM, CSS, HTML and whatever else we throw in there. I probably just missed something among the various versions.

    Suggestions for improvement are always appreciated. Thanks.

  4. Excellent review Roger, I completely agree. I’ve read this book in great detail :)

    FYI Dugg here: Vote up this review on Digg

  5. November 29, 2007 by Roger Johansson (Author comment)

    Nate:

    What are your thoughts? I only ask because there are other books that do the same thing. Programming books can teach excellent programming techniques, and then show really poor HTML practices.

    Yes, I see that a lot. I mentioned it specifically in this review since most HTML examples in the book are as good as any found in books specialised in HTML.

    Jeffrey:

    Thanks for the great review!

    You’re welcome! I really enjoyed reading the book despite my minor nitpicks. I guess I always have to find something ;-).

    I’ll have to go back and take a look at the markup for the image cropping example. I do try to stick to best practices in all aspects of my work including DOM, CSS, HTML and whatever else we throw in there.

    Yes, I noticed that you do, and I think it’s great! Anyway, the problems I noticed are these:

    • The example HTML has an XHTML Doctype but the input elements aren’t closed.
    • The Doctype is Strict, but form elements have inline content (img elements), which isn’t allowed.
    • img elements lack alt attributes.
    • Labels aren’t associated with their form controls.
    • It could be just a matter of personal preference, but I don’t see a reason to put the form elements inside an unordered list.

    Easy fixes, and some of these issues could easily have been caused by cutting and pasting back and forth during editing :-).

    Again, I really enjoyed the book, so please take my nitpicking for what it is.

    Cam: Thanks :-).

  6. Mmm, maybe I should give it a second chance. I started reading this, got a couple of chapters in and felt that the author was jumping in at the deep end and making a lot of assumptions. I couldn’t help but think at the time “If only Jeremy had written this follow-up too” … as I really liked the sequential explain-show, explain-show approach he took with DOM Scripting and Bulletproof AJAX. This really didn’t feel like a follow up to DOM Scripting for me, but some other advanced JS book.

  7. Some of the things Roger mentioned - I share sentiment. Most JavaScript books don’t come hand in hand with good HTML. In contrast, when I find that the markup and CSS is impeccable, it’s generally an introductory JavaScript book. The original DOM Scripting book was like this. Nevertheless, Jeremy’s intentions were never to make it advanced. As he claims, it was meant for Designers and object oriented practices didn’t really have a place. That’s one main reason it still sells very well. Most designers don’t need to know OO concepts and learn the deep nature of Prototypal inheritance, mixins, chaining, etc. I originally nitpicked Jeremy’s book to death when it first came out - without knowing his target audience. In that regard, most of my comments were invalid.

    If anyone is looking for a really advanced, engineering driven book about JavaScript - without the necessary focus on DOM, my book is available for Pre-order called “JavaScript Design Patterns.” The first section of the book (6 chapters) is entirely dedicated to Object Oriented JavaScript. The remainder of the book is broken up into language patterns.

  8. This is good news, I just found another book for my Christmas shopping list. Even if it might just be for the occasional lookup when hitting a dead end.

  9. November 30, 2007 by Roger Johansson (Author comment)

    Ian: Do give it a second chance, but keep in mind that this book has a different target audience than Jeremy’s books, and is more advanced.

    Dustin: Your book is in my Amazon cart :-).

  10. Oh, don’t get me wrong, Roger - I realise it’s a different audience, but I just really liked Jeremy’s way of explaining things, but in this book I found that, quite a lot, I’d read something and think “This will be explained in a moment”, but it wasn’t … at least not for a while, and it got me a bit frustrated. I will give it another go, though :-)

  11. December 2, 2007 by magrolino

    i bought the book as soon as it was available and I simply love it. despite the typos (and the missing remember.pdf which was mentioned on the first pages but is online now :) it is a great resource.

  12. I think this book is very good. I’ll read this book, thanks

  13. Thanks for the article.The book seems to be a good working base. I will give it a try, and order the book. So i ve got useful stuff to read over this christmas.

  14. January 26, 2008 by Casper

    At the time of this writing I’m on chapter 4, and enjoying it so far, a lot actually!! BUT (and this is big IMHO); The typo’s are too many, and too heavy (already) !!!

    Example;

    On p.123, 2 crucial functions about adding onto DOM traversal is explained, but Jeffrey doesn’t mention that these should be added to the ADS namespace (the library one builds through the book) !?!

    I mean, come on?? Be specific and very verbose - ppl like myself (that can hardly even be considered intermediate in this field) need this info!!!

    Also, in the beginning of chapter4 there’s links to pages on advanceddomscripting.com (/links/events/..) for lists of events incorporated in different browsers. Excellent, one may think.. - BUT THE LINKS ARE DEAD!!?? (Jan 26 2008). These aren’t the only examples, and I’ve slowly come to expect more as I progress through the book.. :(

    Jeffrey and Aaron, if you’re reading this - I DO NOT mean to sound like a ranting idiot, but things like these make my rating fall from 5/5 to 4/5..

    It IS a great book, but others may struggle even more than me to notice this stuff.

    Still, thx!!

Comments are disabled for this post (read why), but if you have spotted an error or have additional info that you think should be in this post, feel free to contact me.