HTML5 is the latest “big deal” in web development, and for good reason. It allows us to build interactive websites without the need for add-ons like Adobe Flash. But it’s also the foundation of a whole new class of deliverables like iOS apps, iTunes LP, iTunes Extras, and iAds. And while those are all Apple-related right now, there’s no reason they can’t be used everywhere once IE9 ships. The downside is that HTML5 is not complete, and it won’t be for a long time. But what most people think of as HTML5 is actually a combination of HTML, CSS and Javascript. Right now. While you can find an endless supply of books for each, none has yet covered the new context of manipulating DOM elements (or even explaining DOM elements), the canvas, local storage and all the other new goodies.
That’s where the gold rush brings us in 2010. A number of “HTML5” books were promised as early as last November, only to be delayed again and again. “HTML5: Up and Running” from O’Reilly immediately went to the top of my watch list, since I have a shelf of O’Reilly books already and it would be in good company. It too was pushed back from the original release date, but not by much, and now I have it in my grubby fingers, and it was worth the wait. Mostly.
The first chapter is quick reading, and actually pretty interesting considering it’s just a history of HTML. Old emails from names like Marc Andreessen and Tim Berners-Lee arguing over the img tag, and how we ultimately ended up with the current format, are entertaining. Ok, next. Chapter 2 covers compatibility, since not all web browsers support every piece of the HTML5 moving target, and how to detect if your visitor can see what you’re trying to show them. Then we get a detailed but quick run-through on canvas, 2-D drawing, video codecs, geo-location, local data storage, offline web apps and new form elements. Chapter 10 wraps things up by future-proofing HTML5 and sneaking microdata annotations into your code, and tries to lay down some standards for different types of data in a way compatible with Google’s Rich Snippets. This is followed by a very handy alphabetical guide to detecting the new stuff, and a standard index.
What’s not to like? Well, by the time I finish typing this sentence some of the topics in the book may have changed. Those changes are likely documented somewhere online for free. Three days ago, for example, the MPEG LA group declared that H.264 video will be royalty-free forever. That could set it up as the favored web video standard going forward. Not that this makes the nine pages on encoding Ogg Theora video a waste, but maybe more time could have been spent on interactive UI elements, animation, CSS or 3-D drawing inside the browser instead of external video generation. And when I said “quick run-through” of some elements, I meant it. The chapter on forms, for example, shows how to fall back when using the new autofocus tag, by using Javascript for older browsers. But it doesn’t have any fallback example for the placeholder tag at all.
This book is a foothold, however, and a necessary step to fill the holes in one’s background. Like I said, these are the first books to cover actually using HTML, CSS and Javascript together as the new trinity of web development. The diagrams and code examples for canvas, as an example, are more clear in “HTML5: Up and Running” than anything I had found previously online. I’m looking forward to the next in the series. Recommended.
Disclosure: I received an early copy of this book for review courtesy of O’Reilly Media. This in no way affected my opinion of the material.