Bulletproof AJAX

Reviewed March 6th, 2007 @ 08:11PM

[Book Cover] Bulletproof AJAX

Bulletproof AJAX by Jeremy Keith was an excellent beginners book to AJAX. For those who have read Bulletproof Web Design by Dan Cederholm, this book literally took the same approach. The book starts with the very basics and walks you to the end where you create a fictional bookstore that utilizes AJAX. Each chapter addresses what it means to make an AJAX application bulletproof. The author is brutally honest while informing you the barriers that AJAX faces, and how to get around them. Sometimes the best solution is: don’t use AJAX. Obviously, this isn’t the case for everything — or there wouldn’t be a book to read. I appreciated the approach of making sure that your AJAX applications utilize progressive enhancement and are unobtrusive. These are two key elements when dealing with JavaScript as a whole. The entire journey of this brief (but informative) 200 page book looked a little like this:

  • Chapter 1 answers the question “What is AJAX?” and gives a brief introduction and history lesson as to it’s origins. This is very basic, but begins to get your feet wet understanding that AJAX is not a new technology — but one that has recently hit the spotlight.

  • Chapter 2 gives a thorough overview of the Document Object Model. He explains what the DOM is, how it relates to your structured HTML and Javascript, and the methods associated with traversing the DOM. This is very important as he moves forward to create unobtrusive AJAX.

  • Chapter 3 dives into the XMLHttpRequest object, it’s origins, and how to create a bulletproof instance of the object. This handles the differences between IE and other browsers and how they implement the request. He creates a wrapper for use (and use through the rest of the book) that allows us to send requests, receive responses, and then position it accordingly in the DOM.

  • Chapter 4 covers the Data Formats that are returned by our request. These include XML, JSON, and HTML. He covers each data format, and creates another wrapper for retrieving the different data formats.

  • Chapter 5 introduces HIJAX. This is where he irons out some of his previous scripts. Initially inline scripts were used as examples, but with HIJAX we see how we can create bulletproof implementations of AJAX. Topics covered here include progressive enhancement, unobtrusive Javascript, and rich clients.

  • Chapter 6 forces us to hit a wall (briefly). This chapter discussed the challenges that AJAX faces (and has faced in the past). Some of the challenges revolve around web services and connecting to remote API’s, making your application backwards compatible, how to work around browser inconsistencies and consistencies (The back button and bookmarking), and how to wireframe an application that will change in each section.

  • Chapter 7 discusses accessibility in relation to AJAX. One of the most frustrating parts for any application moving forward is dealing properly with screen readers. Screen readers are incredible tools, but since they sit on top of an existing browser it can make some things rather difficult (especially checking for the existence of Javascript).

  • Chapter 8 starts to wrap things up. Taking everything we have learned to this point, he discusses planning, applying, and bulletproofing your application.

  • Chapter 9, the final chapter, looks to the future of AJAX. Not only did it discuss the future — it covered many of the current frameworks available. He does a great job of discussing the good and bad of using frameworks — and where frameworks are best suited.

Overall, this book was a great read. This book is geared for the beginner, and I believe it will help a user have a complete grasp of AJAX. AJAX is a tricky subject, and Jeremy does a great job of tackling each subject in great detail. This book would go well with a Javascript book to help you bulletproof your applications. This is a must read for those who are interested in understanding AJAX and its place in the world of web standards.