This book, according to Jeremy, “isn’t intended for programmers. This is a book for web designers. Specifically, this book is intended for standards-aware designers who are comfortable using CSS and XHTML.” If you’re new to JavaScript, there’s a rather brief intro to the language, while the rest of the book deals with manipulating the Document Object Model with JavaScript.
The two most important concepts you need to take away are:
Progressive Enhancement…
“The principle of progressive enhancement is based on the idea that you should begin with your core content. The content is structured using markup. The marked-up content is then enhanced. The enhancement might be stylistic, using CSS, or it might be behavioral, using DOM Scripting.”
… and Graceful Degradation
“The corollary to progressive enhancement is graceful degradation. If you have progressively enhanced your content, then it follows that your stylistic and behavioral enhancements will degrade gracefully. Visitors to your web site who lack the means to benefit from your CSS and DOM Scripting will still be able to get to your core content.”
What About Accessibility?
Jeremy raises an interesting point: the old days of browser wars bred too much poorly developed client-side code which lead people to believe that JavaScript was an enemy to accessibility. This is not necessarily the case.
When talking about accessibility, people love to site blind users who use old-era green-and-black monitors with lynx as their web browser. I think it’s a grossly distorted stereotype. Read this very interesting comment from an accessibility consultant at Veerle’s blog. I think I learned more about accessibility from this comment alone than from numerous posts and books I’ve read.
When DOM Scripting Backfires
Another interesting point: If you’re injecting important content with JavaScript, you’re doing it too late. Clients (meaning devices, search bots, etc) which do not support JavaScipt, can’t get to your content.
In this context, DOM Scripting is a tool. When you hold a hammer, everything looks like a nail. So… Use your head and don’t abuse the tool.
Getting Practical
As the mentioned accessibility consultant pointed out,
“In real world situations, designing with web standards has very little advantages for people with physical disabilities. And in some situations, it might even impede accessibility […]. In a more general context (device and user agent independency, future compatibility, bandwidth savings, easier updating, better indexing by search engines and such), designing with web standards is of much more importance.”
I keep hearing this sentiment about users who disable JavaScript or use browsers that don’t support them, but I don’t know if it holds water in real life. Of course, you can join an Amish community and live without electricity, but few (if any) of us do. I’d be worried much more about Ajax which causes content to appear and disappear sporadically.
Conclusion
The book is nicely organized, and the material is very easy to follow. If you want a more technical book in this same subject, check out The Document Object Model book by Joe Marini. And, of course, I’d commit a sin of omission if I don’t mention the best book JavaScript: The Definitive Guide by David Flannagan. Still, DOM Scripting is an interesting read for “standardistas.”
What I really want to see now is a book about pragmatic applications of JavaScript, namely:
In other words, I’d love to see a book on how people use JavaScript for real. In real web products. Not W3C specs.