BOOK REVIEW: Bulletproof Ajax Demystifies The New Technology
 

BOOK REVIEW: Bulletproof Ajax Demystifies The New Technology

Ajax is one of those new technologies that has everyone excited about Web 2.0, but the number of people who actually understand how it works is smaller. Bulletproof Ajax serves to explain Ajax’s underpinnings and get readers on the path to using Ajax appropriately.

Bulletproof Ajax

Jeremy Keith’s Bulletproof Ajax is one of those small, slim books that has a lot of great information for its size. Instead of a 700-page block of paper crammed with code and acronyms, Bulletproof Ajax strives to break down the various technologies that make up Ajax and show how it can be used along with HTML, XHTML and CSS to create rich user experiences on the World Wide Web without making things difficult for those who can’t implement Ajax.

Analysis first

After working with component libraries like Adobe’s Spry (originally available on Adobe Labs, and now integrated with Dreamweaver CS3) one might think of Ajax as a source of rich media tricks, similar to Flash. However, Jeremy begins Bulletproof Ajax with a thorough analysis of what Ajax is, from Jesse James Garrett’s 2005 essay that defined Ajax to the web technologies that make it work. Jeremy has a broad definition of Ajax—“A way of communicating with a Web server without refreshing the whole page”—that encompasses technologies like Flash, Java and even frames, none of which are usually considered true Ajax. That is reserved for the JavaScript object XMLHttpRequest, which was Garrett’s original trigger for Ajax behaviors and is the flavor of Ajax studied in this book.

Ajax—“A way of communicating with a Web server without refreshing the whole page”

The first four chapters are a wonderful introduction to Ajax. Together they do a great job of breaking down Ajax into its components and explaining each one in terms that any web designer or developer can understand. There’s plenty of code to explain and illustrate the concepts, but it’s not overwhelming or difficult to understand, and Jeremy uses code to teach and illustrate the Ajax concepts. After reading this book I don’t think I could code an Ajax application from scratch, but I can definitely look at an application and understand how it functions.

Hijax: Ajax for those who can use it

Unfortunately, Ajax in its present form requires JavaScript in order to function. Not everyone has JavaScript capability, and some who have it keep it turned off to thwart pop-up windows and other web junk. So Ajax developers have a problem similar to what Flash developers have to deal with—Flash requires the Flash plug-in, Ajax requires JavaScript, and there’s no guarantee the end user will have either one. Some designers get around this by creating two Web sites per project, one with the added Ajax or Flash elements and one without.

Jeremy thinks this is a bad way to get around the Ajax problem, since it entails twice as much work and upkeep. “Hijax” is his method to sidestep the problem, and it basically involves developing the Web site as if no JavaScript (and no Ajax) is available, using standard page-based reloads generated by the server. Then, scripts can be used to “hijack” the server requests and reroute them through Ajax. The end result is a single site that offers Ajax for those who can use it and the page-based alternative for those who can’t. This is a practical and pragmatic approach that I like: many writers focus on the more spectacular aspects of web technologies without always acknowledging the need to be practical. I find that the best Web designers use every technology at their disposal while at the same time constructing their Web sites to degrade gracefully yet still work well for most users, if not all of them. Bulletproof Ajax allows you to do just that while getting the most out of Ajax.

Challenges with Ajax

Ajax poses some other real challenges, the JavaScript problem notwithstanding:

  • Web browsers do not show feedback when Ajax is working
  • Since Ajax does not change the URL of the Web page, you can’t bookmark a page and include the results of an Ajax action
  • The lack of a URL change also makes a browser’s Back button incapable of backtracking through previous Ajax actions on a webpage
  • Wireframing a Web site with Ajax is problematic, since changes are taking place on a single page

Bulletproof Ajax does a fine job of explaining the difficulties with Ajax and methods for overcoming them, but it doesn’t gloss over the fact that there are no good solutions for some problems. In these cases, the book argues that the best solution is to find a way to avoid Ajax altogether or at least use it judiciously. It would have been fabulous if Bulletproof Ajax could offer a more fulfilling solution than that, but that is the practical response to this situation. The same thing can be said about Ajax and accessibility, which has a difficult time with things like screen readers and other accessibility aids. Some gurus like James Edwards believe Ajax and screen readers just don’t work together at all at the moment. There are possible solutions coming up in the future, but Bulletproof Ajax doesn’t (and can’t) do much more than explain the various solutions on the horizon, such as FlashAid.

The book itself: well-written but…

Bulletproof Ajax is very well-written: Jeremy Keith writes clearly and has a knack at breaking down the elements of technology to make it accessible to novices. I think this book is an excellent Ajax resource for beginners. However, the book is not without its long passages of code and, unless you are knowledgeable in JavaScript, it may throw readers off track. I wish the code itself had more detailed explanations in places, saying just what each line is doing. That would go a long way to explaining Ajax even further to newbies. However, on the whole the code doesn’t detract from the book.

My one major complaint: I like slim, powerful books, but Bulletproof Ajax may be too slim. This book could easily be twice as long without losing its focus, perhaps expanding its “Putting It All Together” chapter by adding one or two other real-world Ajax applications, building it from start to finish, and using the opportunity to analyze Ajax in use. Like I said earlier, I doubt I could build an Ajax application from start to finish after reading this book. Perhaps I could if the book was expanded. The book would have also benefited from a section looking at Ajax applications on the Internet today. Web sites do change regularly and the section would have been a little outdated in a few years, but then again this book will be outdated anyway as technology continues to evolve and Ajax develops. Analysis of current Ajax applications on the World Wide Web would have been great, especially if we could see some code behind the applications and analysis of how they work.

Conclusion

Bulletproof Ajax is an excellent book for those wanting to know more about Ajax or implement it in their Web sites. The focus on practical use of Ajax technologies is especially inviting. This book alone will not be enough for those serious about implementing Ajax, but it is a great primer and a vital building block for improving one’s web design skills.

Bulletproof Ajax
Jeremy Keith
Published by New Riders
$34.99
Rating: 8/10

Print This Page
Subscribe to the Discussion Surrounding This Article
EMail This Page to a Friend
*Enter Your Name (Required)
*Enter Your Email Address (Required and Kept Confidential)
Enter Your Web Address (Optional)
An asterisk (*) in the field name indicates required information.
We reserve the right to edit or delete comments for any reason.