Christian Heilmann

Reading DHTML Utopia

Tuesday, August 9th, 2005 at 10:24 pm

DHTML Utopia coverI ordered it even before it came out, but as I just got stuck in writing a part of my own chapter in an upcoming book, I finally opened Stuart Langridges DHTML Utopia: Modern Web Design Using JavaScript & DOM published by Sitepoint.

Stuart delivered an excellent book, explaining the concepts of the DOM, the dynamic adding and removing of elements and even hitherto scary concepts like DOM events with all their bubbling and brewing (he has a beer signup form example) in a quick to grasp way.

The book is up-to-date, even including remote scripting, and rich drag and drop interfaces. It seems like every JavaScript enthusiast is more or less doing the same examples, plainly because this is what web designers need. Form validation on the client side is one of those and Stuart explains much like my own unobtrusive JavaScript course why client side validation backed up by a server side script is a good idea. While his example lacks a bit in the error reporting usability (a JavaScript alert is ugly and it makes more sense to get an indicator at the field that has an error than a list of errorenous fields) he goes further though and explains how you can improve the form widgets HTML gives us, with type ahead functionality and autofill suggestions. He then goes on about explaining an animated menu system and ends with AJAX examples which are pretty much on the bleeding edge of what we can do these days. Stuart also covers Safari issues, which is a good thing to know, especially for those of us who have no access to a Mac.

Donning my pragmatic developer and accessibility fan hat, this is where I get a bit less enthusiastic about the book, especially in connection with the confusing title. First of all DHTML brings back bad memories of codeforking, useless animation and bloated code libraries. Secondly, these rich interfaces are an option, but not necessarily the future, after all we had them in Flash for a longer time and visitors were not always too happy about that.
Stuart does a very thorough job explaining the pitfalls of these solutions and everything, but as we all know, the flashiness of a solution is much more important to the spectator than the parts you have to worry about.

For example the menu chapter, while nicely explained and all, is nothing that really is new or especially clever. It is one of the cleanest solutions, but the big problem of multi level dropdown lists is not how to make them animate without causing too much memory leaking, the problem is that they lure developers into adding dozens of links to a page that are not really connected to the current section. Users without JavaScript will have to navigate through those on every page in the site, as hiding them is not removing them. A really cool menu example would have been one that interacts with a backend script to only apply nested menus when the mouseover event occurs, thus only offering the extended navigation options to those who have a use for them.
All in all I am really happy I bought the book and the free DOM poster hangs in our office now as a quick reference for our developers.
It is a great book to have at hand when you are really into developing JavaScript and are tired of scanning through lots of tutorials, mail threads and article comments to get a quick answer to a certain problem. The heat is on in the JavaScript world, and rather than following flame wars of AJAX warriors versus “I need to make it work in browser XYZ now” developers a quick glance into this book helps you find what you need quickly and efficiently.
It is a book aimed at developers, if you are a designer and you want to learn JavaScript from the ground up it is an option to learn the best practices now, but you will have some learning curve ahead.
I am waiting now for Jeremy Keith’s DOM scripting book to see if that will fill this gap and go back to finish my own chapter about “Accessible JavaScript” for “Constructing Accessible Web Sites”.

Share on Mastodon (needs instance)

Share on Twitter

My other work: