Second Edition

The second edition of DOM Scripting has just been released.

Let me start by clarifying: although my name appears on the cover, I wasn’t involved in this edition at all. It’s all the work of Jeffrey Sambells. The publisher—Friends of ED—asked me to write the second edition, but I just didn’t have the time available to commit to it. So it was a certain amount of trepidation that I cracked open the cover of the new release.

I’m happy to report that all the changes meet with my approval. Well, almost all the changes …the actual cover is pretty naff. Given the sort of beautiful books produced by small independent publishers like A Book Apart and Five Simple Steps, I’m always surprised by the relatively roughshod design displayed by more mainstream publishers.

Anyway, ‘though the presentation may leave something to be desired, the contents of the second edition is pretty darn good. The book has been expanded to cover three new areas:

This widens the scope of the book quite a bit, but happily the emphasis remains on best practices (especially progressive enhancement).

The markup examples have been updated to use the HTML5 doctype—although occasionally the text still refers to them as XHTML documents.

The Ajax examples are necessarily curt, but they manage to convey much the same message that I was expressing in Bulletproof Ajax: don’t take the existence of Ajax (or JavaScript, for that matter) for granted.

I think my favourite addition to the book is the section on jQuery. It revisits many of the examples from earlier in the book and shows how they can be rewritten more succinctly with jQuery. I think that’s pretty much the ideal why to get to know a library: first understand how the underlying language works, and then find out how the library can help you save time and effort.

So all the additions to the book are beneficial, in my opinion. There’s only one thing that has been removed from the original book; the appendix of DOM methods has been replaced with an appendix of jQuery methods. That’s a bit of a shame. I’ll see about getting the original appendix published here on this site.

On the whole though, the second edition gets a thumbs-up from me. If you already have the first edition, I’m not sure it’s worth getting this new one: you’d probably be better off with dedicated books on HTML5, Ajax and jQuery. But if you’re looking for an introductory book on JavaScript, I think the second edition of DOM Scripting—even with its expanded scope—is as good as it gets.

Posted by Jeremy on Monday, January 3rd, 2011 at 10:57pm


I have the first edition of your book and I used it a great deal when learning. Thanks for the overview of what’s new because I had considered the updated version, but I’ll take your advice and focus on the dedicated books for the new topics. Do you have any more new books in the works?

# Posted by James Donaldson on Monday, January 3rd, 2011 at 11:17pm

I own the first edition of this book, and it has helped me tremendously. I’ll be certain to pick a copy up of this version as well, especially after all the great things that were added.

# Posted by Lasha Krikheli on Monday, January 3rd, 2011 at 11:30pm

It does seem a bit misleading of the publisher as the book is marketed with you as the author (Jeremy Keith / with Jeffrey Sambells) despite having zero involvement in it. cover:

Makes me uneasy. :/

# Posted by Paul Irish on Monday, January 3rd, 2011 at 11:36pm

Well, the majority of the book is what was in the first edition. There’s maybe 15-20% of new stuff. So I am the author of most the book.

But yeah, it would probably would would’ve been more honest to label it as "Originally by Jeremy Keith with updates from Jeffrey Sambells."

# Posted by Jeremy Keith on Monday, January 3rd, 2011 at 11:42pm

Ah. I follow.

So it’s not a 100% rewrite which is sorta what I was expected (Hey, folks have changed the way they do DOM scripting a lot in the past few years :)

# Posted by Paul Irish on Monday, January 3rd, 2011 at 11:45pm

I’ve picked this second Ed. as an eBook, having already bought a copy of the earlier edition.

Bit surprised there’s not much mention of Event Listeners as opposed to Event Handlers though? I guess jQuery will be used to handle these events?

Anyway, back to the book..

# Posted by Simon on Wednesday, January 5th, 2011 at 12:44pm

I am desperately looking for guidance in DOM, because for last few months I have been designing websites using jQuery, and their have been puzzling issues, some of which still remain unsolved despite of never ending search on the Internet for answers. It all comes down to my poor understanding of DOM. In the past, I always bought books whenever needed to get hold of a subject, and thats how learned all the web and the Internet technologies, and now again starting doing the same, starting with your book. After reading all the good comments, have already ordered it a few minutes ago. I believe only in the print versions, so ordered only the printed one.

My problems are mostly regarding on which pages to define what jQuery and JavaScript functions. If everything is defined in on .js file and is referred to in the header of the main index.php page, some functions don’t get propagated to the items later loaded in the divs, and some do fine. Some of the code I have to remove from the .js file and move to the pages which are later loaded, and yet clicking on another link, and coming back to the earlier one breaks the DOM hierarchy. It is very confusing, though I am getting better at it with time, and hopefully this book will help me significantly in this direction.

# Posted by Zeeshan A Zakaria on Tuesday, January 25th, 2011 at 5:56pm

Thanks for the news. Here in Germany the second edition is already available via amazon (and maybe other online bookstores). I will definitely have a look.

# Posted by Peter on Monday, January 31st, 2011 at 6:52pm

Sorry. Comments are closed.

January 2011

Recommended Reading

XML Subscribe

Grab the RSS feed for this blog.

JavaScript API

Grab the RSS feed of comments for this entry.