XML Responses and AJAX
(Page 1 of 5 )
In a previous tutorial we looked at the
responseText property of the
XMLHTTP Request. This tutorial will focus on the
responseXML accessor.
Introduction
If the response is XML, the responseXML represents the value derived via DOM object parsing. The reader should review the properties and methods discussed in my previous tutorials on AJAX and XMLDOM, so that reading this one will be easier. JavaScript works easily with the XMLDOM object. In this tutorial we will be accessing an XML document via AJAX.
The two tasks of the XMLHttp are handling the HTTP request, and then processing the XML response. The first one is easily done by writing the appropriate syntax for creating this object. The second is achieved via reference to XMLDOM.
var xhr=new ActiveXObject("Microsoft.XMLHTTP"); is the correct syntax for the Internet Explorer and
var xhr=new XMLHttpRequest(); for the Mozilla Browser.
Next: A brief explanation of innerHTML >>
More XML Articles
More By Jayaram Krishnaswamy