Book review: O'Reilly Javascript Cookbook

Javascript CookbookThis book on Javascript follows the O'Reilly Cookbook series 'recipe' format, laying out a whole list of practical problems and tasks that (aspiring) Javascript developers are faced with, and provides the solution and background discussion needed to truly get the task done, and understand the reasoning behind it.

The first few chapters of the book start of by explaining the basics of the Javascript language, providing insights and tips around working with strings, numbers, arrays, loops, functions, events etc... A seasoned Javascript programmer will probably already be familiar with most of this functionality, but I found it interesting enough to keep on reading these 'basic' chapters, because the author gives a good background explanation and points to more obscure or browser-specific problems that arise when using these concepts.

The next few chapters go a little deeper into error handling, debugging, the different methods to accessing DOM elements, and adding interactive functionality to your webpages. The author took a very interesting approach with the chapter on interactive elements, by focusing highly on having the ARIA (Accessible Rich Internet Applications) attribute set baked in into the examples. I hadn't used this myself before, and found it truly fascinating to read how to make rich Javascript interactions accessible to all users, with only a few lines of added code in most cases.

The more advanced chapters in the book explain in great detail the newer cutting edge functionalities that are starting to be implemented by most browsers, including working with HTML5 audio & video elements and persistent data storage, SVG graphics, canvas elements, etc ... The book even covers topics that are just recently included (or even not included yet) in modern browsers, giving the reader an idea of what the exiting new functionalities are about, and how to leverage them. In the last chapter we leave the browser and explore Javascript in other environments, such as browser extensions, mobile widgets, etc..

One downside of the book is that it doesn't take IE6 into consideration anymore, which is unfortunately not the case in real life situations. Perhaps some more information on how to provide graceful degradation for IE6 would have been helpful.

Overall this book provides a lot of great insights and best practices regarding a wide range of topics, aimed at Javascript developers with various skill sets, and is very thorough and detailed in its explanations.

Book details:
Title: Javascript Cookbook
Author: Shelley Powers
Link: Javascript Cookbook on - Javascript Cookbook on