Ajax and PHP

7 comments | Posted: 12 April 06 in Books, by Nathan Smith

Ajax and PHP There need to be more Ajax books like this. No, let me rephrase. Rather, more of the Ajax books out there should’ve been like this one. I just finished reading through Ajax and PHP: Building Responsive Web Applications and it is by far my favorite book on the topic of Ajax yet. The authors of this book: Bogdan Brinzarea, Mihai Bucica, Cristian Darie and Filip Chereches-Tosa have done a great job of keeping the topics focused and applicable.

While other books I have read covered the concepts behind Asynchronous JavaScript and XML, they did so with a shotgun blast of information. While I appreciate an eclectic approach, it is irrelevant because many examples are for languages I never use. For instance, one single book might have a slew of exercises in ASP.NET and Java, with maybe a few chapters on PHP.

Sure, I could install Microsoft’s .NET SDK or Sun’s J2EE, but the likelihood of me every either using these two platforms is pretty slim. Don’t get me wrong, I’m not against Microsoft or Sun as companies. I use Windows like everyone else, and am quite fond of OpenOffice. Suffice it to say, I am a front-end designer who is familiar with PHP.

There is a full gamut of examples to test out. I liked the way they list the full code in the text, in addition to offering the option of downloading it from Packt. I’ve read too many programming books that assume you’re right there at your computer while reading. I don’t know about you, but I like to take books with me to read when I can grab a spare minute here or there.

Before I get into the contents of the book, let me point out a few caveats, in case you are considering purchasing it (which I would still recommend, if you’re into PHP). In some of their code examples, they use XHTML 1.1. This is all well and good, but they neglect to specify content-type, meaning that it defaults back to text/html. So, while it still works just fine in a browser, it is against the W3C recommendation for how to serve various media types.

Here is a screenshot of the specifications, found here. As you can see, XHTML 1.1 should be served only as application/xhtml+xml, so their code examples would be better off as XHTML 1.0 Strict, because they aren’t making use of any of the additional features to be found by stepping up to 1.1. Another thing to correct in their code would be line-breaks, which are consistently written throughout as <br/> when really it should be <br /> (note the space).

Anyway, here is what topics are covered in the book: JavaScript and the Document Object Model, some CSS, XMLHttpRequest, proxy servers, and MySQL. They also touch on how to make use of Prototype and Script.aculo.us. Using this armament, they show you how to create fun stuff such as: live form validation, chat room (with color picker), auto-complete search, real-time SVG charts, XSLT grids, an RSS reader, plus a drag-and-drop to-do list.

While some of these topics are covered in other books out there, I had not found one which covered them all from a PHP standpoint. Now that I have, I think I will probably give book reading on Ajax a rest (not REST) for awhile, because I think that with this book, I am contented. Now it’s just a matter of going out there and actually making use of the topics that were covered.

Update: A new section has been added on JSON, as well as a few other case studies available as PDF files. You can get them from Cristian’s website, here.

Discuss This Topic

  1. 1 Adam Spooner

    An honest review…nicely put Nathan.

    I’ve never read anything on AJAX and would like to. Do you recommend anything for a complete newb on the topic? I have a firm grasp of most programming languages…and if I don’t, then I pick up pretty quickly on them. I’m just looking for a good starting point. I have a Safari account, but I can’t find anything worth looking at on there about AJAX.

    Thanks for any advice! Cheers!

    Side note – typing with a wrist brace is annoying as all get-out! I have a ganglion cyst on top of my left wrist (computers and guitar have led to this…) and am having to wear a brace until my out-patient surgery to have it removed.

  2. 2 Nathan Logan

    So Nathan, now that you’ve read it, it’s up for loan?


    Thanks for the review. I’ll definitely be reading this one.

  3. 3 Nathan Smith

    Adam: If you read any book on Ajax, that will pretty much cover the subject. Most all of them mention Jesse James Garrett, etc. For me, the distinguishing factor is what languages and code examples are given. That’s why I love this book, because I can play around with it in a test environment I’m used to. So, depending on the back-end language you want to learn about Ajax with, just find a book on that topic. There are so many out there, just choose one.

  4. 4 Rick Curran

    Mmm, interesting. I just went and ordered a copy, it does sound like the right book to read from the sounds of it.

    They also have it as an eBook for those who can’t wait for the mailman!



  5. 5 Adam Spooner

    Nathan: Thanks for the adivce!

    I just bought Pragmatic Ajax…I’m a fan of their books (they make the reading/learning fun). I’m going to start reading the PDF tonight when I get home.


  6. 6 Cristian Darie

    Nathan, thanks very much for taking the time to write this review! I’ll add a link to it on my website.



  7. 7 Nathan Smith

    Cristian: You’re welcome. Thanks for taking the time to write the book, so that more visually oriented front-end people like myself could gain a fuller understanding of all this Ajax buzz. I’ve already recommended it to others.


Comments closed after 2 weeks.