I started reading Head First Ajax.
If you liked the Head First Patterns book, this is the same format. Easy to understand. Gets you a good, quick understanding of the topic. It’s definitely taken the mystery out of Ajax for me.
Asynchronous. No problem. You’re a Flash developer. Ever load a movie clip? A jpg? XML? You create an object, set an onLoad handler, pass it a URL to load. When the content is in, the handler fires and does something with the content. Apparently this is a revolutionary concept in the HTML/JavaScript world.
JavaScript. Think AS1. Add the DOM, which is just a tree of elements. Think nested movie clips with some methods to find things. Or better yet, if you know AS3, think Display List. In another sense, it’s similar to working with an XML document, creating and appending nodes, setting attributes.
XML. Yeah. XML. Cool.
For me, the biggest thing is realizing how powerful DOM scripting is. I’ve done pretty little with HTML overall. I was surprised you can do so much with it. From there it’s just setting up the request object, setting up a service to return some data, calling it from JavaScript and manipulating the DOM with the result.
Of course, there are various libraries and frameworks that build in all kinds of even more powerful features.
I doubt I’ll be building any huge AJAX apps in the near future, but I do have an idea for a small project or two. Anyway, it’s nice to get at least a basic understanding of the subject, so when I hear people talking about it, I’m not totally in the dark. Another reason it’s good to know is that AJAX is often positioned as a competitor to Flash. It’s hard to answer that when you don’t really know what it is. If anything, now I see how I could use the two together to make some pretty cool things. Stay tuned…