Book Review: Dom Scripting
I recently attended an AJAX course in London that, because of the nature of the beast, also included some stuff on DOM scripting. The person running the course was Jeremy "the middle name's Dom, don'tcha know" Keith which, if you know Jeremy or know of him, means that the inclusion of DOM scripting in that course should not have been a surprise. It wasn't. What was, though, was this admission from Mr Keith:
"I wrote a book about DOM scripting but if you can avoid using it, you should avoid using it"
I've actually scribbled that on the inside cover of my copy but strangely it hasn't stopped me picking up the book and reading it through! The point Jeremy was making was that DOM scripting has its place, but when its mixed with AJAX-like technologies, sometimes making lots of finicky changes with DOM script commands is overcomplicating things somewhat, particularly if all you are looking to do is update one specific part of a page, rather than several separate parts at once. In that instance, it might be better to use … wait for it, wait for it … the proprietary
Ye gads! Did we really hear that? Use something that is not part of any recommendation but, rather unfortunately for all of us geeky standardistas, works rather well across all sorts of browsers? At this point, I'd like to repeat another quote from Jeremy:
"If you're using innerHTML to update content you're kinda just vomiting the content back on to the page."
The book contains examples for usage such as an image gallery and an animated slideshow, accompanied by an example web site. There is also some coverage of using DOM scripting to enhance forms, although I admit that I would have liked to see a whole chapter devoted to that aspect – maybe something to consider for a second edition, Jeremy?
An important concept that is touched on at the end of the book is the idea of 'Hijax', or 'hijacking AJAX calls'. In other words, allowing a web page to work when AJAX technologies are not available for whatever reason (scripting disabled/not available, script blocking firewalls stopping updates to page content etc). Again, like the forms section, this is something that could be greatly expanded upon as I really feel that AJAX (which may or may not include some DOM scripting) is one of the biggest hurdles for web accessibility in a long time, and in the rush to implement something cool many people are causing those with specific needs to trip over those hurdles in a variety of different ways.
Rating (out of ten)
|Appropriateness for beginners:||
|Variety of topics covered:||
and the Document Object Model
|Where to buy||Buy from Amazon US, Amazon UK and other locations|
|Publisher||Friends of Ed|
|Written by||Jeremy Keith|