Relevance Review #4: Head Rush Ajax

來源:互聯網
上載者:User
URL:http://blogs.relevancellc.com/articles/2006/04/12/relevance-review-4-head-rush-ajax

Relevance Review #4: Head Rush Ajax

Head Rush Ajax, from O'Reilly, by Brett McLaughlin.

Quick summary:Fantastic introduction to the basics of Ajax if you can stand the format. Have one copy for your team and hand it to the new programmers during their orientation.

The Head Rush (and Head First) series are wildly popular. I can't argue that. What I can't figure out, really, is why. I'll let my wife explain it for me. Honey?

My wife: Is that the next book you are reviewing? You're only on page 3. You're going to be up a while.

Me: It sure is. Head Rush Ajax. Nifty title, no?

My wife: I guess. Hey, tell them to get rid of the picture of that goofy guy over in the margin.

Me: Uhhhhh....[flips through rest of book really fast to demonstrate goofy guy on every page]

My wife: Don't people find that insulting?

Me: Uhhhhh........[doing best Butthead impersonation]

Yes, this is an homage to the Head Rush conversational style...its like a meta-review, see?

So, these series use informal language, tons and tons of pictures, lots of diagrams, and every font in the I-just-discovered-the-font-menu-in-Word-2003 pantheon. They explain this up front by saying that your brain really only pays attention to tigers. And Comic Sans, apparently. And, honestly, I can't argue with Brett or Kathy Sierra on this: they've sold a ton of books, and people seem to dig it. Let's just say that I could have used one less picture of the Project: Chaos guy who looks like a well-armed Devo fan.

As for content, it is hard to imagine a book that nails its target audience better. They say the book is for the programmer who has done a lot of HTML, and a little JavaScript and CSS, and no Ajax. They specifically say it isn't a reference book, nor for advanced programmers. They are right on both counts. Which is why we recommend having a copy to hand to every fresh face your Web 2.0 startup hires straight out of middle school or the J2EE Enterprise ecosystem.

I actually love the technical content here. Its a perfect primer for Ajax. They cover:

  • creating XMLHttpRequest objects across all browsers
  • Invoking them asynchronously and synchronously (with bonus material clearly delineating the two)
  • Harvesting the results while checking for readystate and status codes
  • Utilizing XML as the request/response payload
  • Extensive DOM navigation techniques
  • How JavaScript is loaded and parsed in a page execution context
  • JSON vs. XML for data transmission
  • Security issues like SQL injection and rogue eval() calls

It is the perfect beginner's mix of how to get stuff done without screwing up. In addition, the code is robust, and the descriptions are filled with helpful tips about the kinds of status codes you might expect, how to defeat IE URL caching, and little stuff that drives the beginning programmer crazy because they are hard to Google.

Unfortunately, because of the format, it takes a whopping 395 pages to get through that list, while another book would probably do it in under 50. Which is why, having read it now, I'll not crack its glossy, shiny, brightly colored cover again, much as I enjoyed the author's writing style, wit, and dedication to his craft.

Finally, at the end, there is a brief introduction to the idea of Ajax toolkits with a half-page example of "using" each. They hit the right candidates: Prototype, Script.aculo.us, Dojo and Rico, but they only focus on the abstractions wrapping around XMLHttpRequest (in Prototype and Dojo) or simple DOM access (Script.aculo.us and Rico) without even mentioning that these libraries do so much more. Dojo, in particular, needed at least a sentence describing it as the most ambitious JavaScript library ever created.

Probably the only other downside to this book is that all the server code is PHP. There is nary a mention of other server-side possibilities, and therefore no examples, either. Which means the text doesn't even mention the possibility of other kinds of Ajax apps (using remoting, or even code-centric Ajax). They also, strangely, don't mention SAJAX or XOAD, the two major PHP Ajax toolkits. If you're going to do an entire book on PHP and Ajax, and then have an appendix listing Ajax toolkits, it seems appropriate to mention the shaded part of the Venn diagram.

In all, I'd highly recommend this book to the new learner. Said learner should definitely have a little HTML background and have written at least a couple of lines of JavaScript. No CSS or DOM experience required. At the end of the book, that developer will be able to write simple Ajax apps, understand the value of Ajax frameworks, and draw a tiger from memory.

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.