"JavaScript? No way. It's inaccessible, you know. Relying on it will make your site unusable, too. It's the root of many an evil pop-up window. I mean, it probably even kicked your dog when no one was looking."
Or so I thought...
Are you like me, a web designer or developer who has avoided JavaScript on principle? There are a lot of us out there, and no wonder. With so many examples of bad scripting living on in outdated web tutorials from the height of the dot-com era, the overwhelming resistance to using it is no large surprise.
Thankfully, there are people out there like Jeremy Keith working to point us back in the right direction. In this book, he shows us that, hey, it's not as bad as all that. When used properly, with care and attention paid to the traditional JavaScript gotchas, DOM Scripting is a powerful and even vital addition to the web development toolbox.
In fact, the state of DOM Scripting at the moment reminds me of where CSS was in 2002. Up to that point, CSS had been considered this quirky little web display language which no one used for anything more than font styling.
But then interest in CSS-based layouts exploded, and the tide started to turn. High-profile commercial redesigns by Wired and ESPN, the first of many, triggered a change in opinion. I contributed by launching the CSS Zen Garden in early 2003, a project meant to spark interest in the capability of CSS amongst designers. By the end of that year, CSS had shifted from a specialty item to an expected method of development for many organizations.
And now we see DOM Scripting sitting at the beginning of a similar curve. With high-profile applications like Google Maps and Flickr recently taking advantage of DOM Scripting, the demand is growing. More than ever, people like you and me are interested in honing our scripting skills, and learning how to make the power of the DOM work for us in ways that will enhance usability, not hinder it.
Lucky for us, we now have this book to lead the way. And I couldn't think of a better person to learn from than Jeremy Keith. As a driving force behind the Web Standards Project's Scripting Task Force, he's on top of all the latest developments in powerful, unobtrusive scripting. Besides, I've been stealing his code for ages anyway, at least now that it's in convenient book form I don't have to feel so guilty about it.
And it is a great book to learn from. After stumbling through the first few code examples, I was hungry for more. After reading through the first chapter, I knew I was hooked. Jeremy Keith is blessed with the rare ability to explain advanced concepts in simple, easy-to-understand English. He takes the time to back up his claims with common-sense examples, so that you don't simply know what to do, you also know why you should be doing it.
It's time to toss out the browser sniffing in favor of object detection. No more assuming every visitor has JavaScript enabled either. Let's lose the inline event handlers, once and for all. The web is getting an upgrade, and the techniques in this book are going to help it come about in a way that benefits everybody.