DOM Scripting: Web Design with JavaScript and the Document Object Model

Reviewed August 29th, 2006 @ 08:32AM

[Book Cover] DOM Scripting: Web Design with JavaScript and the Document Object Model

DOM Scripting by Jeremy Keith gives you a very smooth introduction to JavaScript and the DOM. The books is more directed at those who are just beginning JavaScript or have used it in the past but would like more knowledge.

The book itself flows well from chapter to chapter. The beginning chapters give you a foundation to work with during the rest of the book. Jeremy teaches basic constructs of JavaScript programming and how and where they can be used. If you are already a programmer (not necessarily JavaScript), this chapter will be a quick one. It is very informational, yet straight to the point. Once he gets the basics and best practice techniques out of the way — he dives into the DOM and gives several useful examples. This is where it gets good.

Before moving further, I should mention that his best practices are applied all throughout this book — and that includes creating useful and unobtrusive JavaScript. So, with each chapter he shows the process and then brings it around full circle to an unobtrusive model. For instance, with the image gallery example, he shows that without JavaScript, this process would be useless, and we don’t need extra markup on the pages that won’t be used. He shows you, step by step (with great code highlighting and screenshots), how to build the image gallery on the fly. This way, if a user has JavaScript they can get the better experience. For those without, it degrades gracefully and doesn’t add unnecessary code to the markup. This is just one example — but is used on all of his building blocks throughout the book.

There were many times in the book I would question what was being done (from an unobtrusive standards perspective). Each of those questions was immediately answered in the paragraphs or chapters to come. Jeremy does a great job to present the big picture, along with explaining why things were done certain ways. I read this book in two days, simply because it was hard to put down. The last chapters (aside from the reference), were the icing on the cake. This is where he puts all of the pieces together for a fictional website, JayScript and the Domsters. This chapter takes all of the pieces taught throughout the book and puts them in a practical environment. Go ahead, play with the fictional site. It has nice little touches, that, even when JavaScript is disabled has a nice user experience.

Overall, I would highly recommend this book if you are looking to get your hands dirty with JavaScript and DOM Scripting. The book was an easy read, packed with useful information. Just as with CSS Mastery, each chapter would build on the last — all the way until the end where it was all put together as a whole. Also, I am currently reading DHTML Utopia, and this book was a great primer to JavaScript techniques. Thanks, Jeremy, for a great, concise, book on a topic that can sometimes scare people away.