After previously reading Web Standards Solutions and adoring it, I’ve been keen to read another book published by Friends of ED. All the buzz about AJAX and the comeback of JavaScript made me pick up DOM Scripting by Jeremy Keith. Though not quite the same calibre as the previous book, Friends of ED delivers an informative book that I expect to continue to use in the future.
I applaude first-time writer Jeremy Keith for his efforts. Though his prose is sometimes choppy, and he relies too much on cute little anecdotes, he does pass along good information when he gets to the point. Often, though, he repeats many things he’s stated already, almost verbatim. I like the way his code evolves as he writes it for the examples. My own code changes in a similar fashion. However, by following the same structure every time, he gets repetitious. For instance, at the end of each code sample, he eagerly explains that we should write code to check a browser’s capabilities. He should have made a special note of it a couple times because it’s important, but a reader should understand the code he uses in later examples without an extra paragraph for why that it’s there.
That said, I’m very happy Keith gave strong reasons why a coder should write portable code. He explains that a page should contain all the most important content, and that the markup should not assume a user has Javascript or that it’s enabled. Not all implementations contain the same functions, and failing gracefully is key, so he adds checks for specific functionality to make sure the page doesn’t throw any weird Javascript errors.
The book is mostly aimed at designers, so as a software engineer I got a little bored as he covered the basic details of JavaScript and the best ways to format code for readability. I tried hard not to skip sections, though, because Keith kept slipping useful nuggets in there that I knew I could use. Some of the examples he created showed a basic, but useful, framework for a couple things I had planned on building myself. In the end, this book made me think a lot on how best to implement dynamic functionality without leaving users that don’t have, or don’t want, Javascript behind.