Adding the "x" to Ajax

Lesson 12, "Returning Data as Text," and Lesson 13, "AHAHAsynchronous HTML and HTTP," dealt at some length with the string value contained in responseText and looked at several techniques for using this information in applications. These examples ranged from simple updates of page element text to applications using more sophisticated data structures encoded into string values that can be stored and transferred in the responseText property.

The X in Ajax does, of course, stand for XML, and there are good reasons for using the power of XML in your applications. This is particularly true when you need to use highly structured information and/or perform complex translations between different types of data representation.

As discussed previously, the XMLHTTPRequest object has a further property called responseXML, which can be used to transfer information from the server via XML, rather than in text strings.

You saw in Lesson 11, "Our First Ajax Application," how JavaScript's document object model (DOM) methods can help you process this XML information. This lesson looks at these techniques in a little more detail and hopefully gives you a taste of what Ajax applications can achieve when leveraging the power of XML.