Building Your Own AJAX Web Applications

p. !

p. You’ve got to respect a man who dedicates his book to his wife and kids. Everything else aside it shows that he’s got his priorities in line. That’s how Matthew starts this book, with a dedication to his wife Masako and his three boys.

p. The Preface of this book is interesting because it has a paragraph on “who should read the book”:http://www.sitepoint.com/books/ajax1/. Most authors would simply put “Anyone who has the $$$ to buy it should read it” but Matthew puts a bit more thought into it than that. According to Matthew, the book is targeted at developers who are already familiar with web technologies like JavaScript and CSS. He also mentions that “traditional application developers” (both of them left out there) might also find it interesting because they can learn how to create “real desktop-app-style interfaces” that run in the browser.

p. Once through the Preface, the book dives headlong into an overview of AJAX. While I do love the opening quote from Gen. Kala out of “Flash Gordon”:http://www.imdb.com/title/tt0080745/ (one of my personal favorite movies), the rest of the chapter is mainly definitions of terms that, if you don’t currently do web development, you may need to know. If you are not familiar with them then it’s good to have the definitions handy. However most of the target audience I know (including the lovely and talented “Kathy”:http://www.kathyevans.biz) just skipped over it as if it were part of the preface.

p. Ahh but once you get past Chapter 1, Matthew heads for deep water. Chapter 2 is a great introduction to the XMLHttpRequest object. Matthew takes you through the basics of how to use it and holds your hand through a simple application to show you how things are done.

p. In Chapter 3, he introduces the “A” in AJAX. (The title reminds me of the M*A*S*H episode where Frank Burns discovered that the “M” in M*A*S*H stood for mobile.) A lot of people ignore the A in AJAX and use SJAX. Since SJAX isn’t nearly as cool of an acronym, Matthew wants his readers to not only understand what asynchronous means but understand how to use it. The sample application for Chapter 3 builds on the work done in Chapter 2. Instead of just sending a single message to the server and getting a message back, Chapter 3 shows how to expand that into a simple polling loop. It covers everything from gracefully starting and stopping the polling to styling the “Application Monitor” so that it looks nice.

p. Chapter 4 deals with sending HTTP POST requests. To illustrate the point Matthew creates a login prompt page that uses AJAX to communicate with the server. Again, no stone is left unturned. He walks the reader through everything from building the methods in your growing AJAX class to the CSS necessary to make it work and look cool. (Well, as cool as you can look without rounded corners.) :)

p. Starting in Chapter 4, the book takes an interesting side road. Matthew go to great lengths to show you how to code AJAX applications that still work with Screen Readers. Sixteen pages dedicated to a topic a lot of us never even think of. TO his credit, Matthew shows you how to build your interface so that you don’t sacrifice the usability for the majority of your users and still allows those who need “accessibility”. Through out the rest of the book, where appropriate, Matthew touches on the subject. Not in a heavy-handed way, just as a reminder that you can increase your user base with a few easy pikes of code.

p. From here on out, the book delves deeper and deeper into AJAX. In Chapter 5 Matthew does make the point that AJAX purists will insist that it’s not AJAX if it does not use the XMLHttpRequest object. He (and I) consider this to be “pure silliness”. Chapter 5 helps you build an edit-in-place blog page and shows you some of the non-XMLHttpRequest AJAX goodies. Chapter 6 walks you through a “Slide and Hide” toolbar and using web services. Chapter 7 deals with more web services and the bane of AJAX programming, the dreaded “Back Button”. Matthew presents you with two solutions to choose from and shows you how to code them both. Finally, Chapter 8 deals with the mother-load of AJAX whiz-bang, the drag and drop. Matthew walks you through creating a simple Chess client. He covers extensively things like position for the drop, detecting collisions, etc. He even shows you how to build a simple server so that two people can play across the net.

p. All in all I think this is a good book. I’ve already recommended it to several of my friends and family who want to know more about AJAX. However, I do have a problem with the book. I know the X in AJAX stands for XML but the majority of AJAX I see being written today used other languages or protocols to communicate between the client and the server. Matthew touches on the two most popular YAML and JSON but only briefly. JSON is a much easier protocol to use for payloads than XML (IMO) and I would have liked to seen more than a passing reference to it.

p. In closing, a book is only as good as the quotes used to open chapters. If you take that seriously (and I pray to the gods that you don’t) then this is a book of historic proportions. Each of the eight chapters have great quotes opening them. I won’t spoil them for you (for obvious copyright reasons) but I will list who the quotes are by so you can get an idea of what I’m talking about

# General Kala, Flash Gordon
# Rush (the band, not the radio talk show host)
# Willy Wonka, Willy Wonka and the Chocolate Factory
# John Crichton, Farscape
# Inigo Montoya, The Princess Bride
# T-Rex, The Slider
# Steely Dan
# “Chief Engineer Montgomery ‘Scotty’ Scott, Star Trek (TOS)”:http://www.startrek.com/startrek/view/series/TOS/character/1112502.html

p. =C=

Published: September 29th, 2006 at 4:58
Categories: Uncategorized
Tags: , , , ,

2 comments to “Building Your Own AJAX Web Applications”

Well… I may just buy the book for the Steely Dan quote alone! Thanks for the review… I always enjoy your book reviews.

It is one realy nice reviews, I amd newbie for AJAX, hope this book can give me which I need, Thanks for this greate review, Thank you.