Hi,
I have a requirement where in on click of a button, I make asynchronous request to a
servlet which in turn sends an XML as response, which is then used to update the page without any reload.
But in my AJAX call back method, when I do request.responseXML i am getting blank value.When i give an alert for request.responseText, I am able to see the complete xml content that is sent from servlet in response.
I have checked the correctness of xml file, by running the servlet alone.XML file gets loaded in IE properly without any errors.
I am not able to figure why request.responseXML is not giving me the XML response. Can any one please let me know the mistake/problem that i am facing?
I am using IE6 and
Tomcat server with eclipse
Below is the code snippet of my AJAX call back function
CODE:
_________________________________________________________
function updatePage()
{
if(request.readyState == 4)
{
if(request.status == 200)
{
var xmlDoc = request.responseXML;
alert('after reading response:' + xmlDoc);
alert('responseText: ' + request.responseText);
alert('responseXML: ' + request.responseXML);
...
}
}
}
[/CODE]
_________________________________________________________
XML sent from servlet in simple form is as below:
<?xml version="1.0" encoding="UTF-8" ?>
<order>
<name>Nagasree</name>
<phone>12345</phone>
<address>street 20,California</address>
<noOfPizzas>2</noOfPizzas>
</order>
Please let me know what could be the problem.
[ August 22, 2008: Message edited by: pinky suresh ]
[ August 22, 2008: Message edited by: pinky suresh ]
[ August 25, 2008: Message edited by: pinky suresh ]
[ August 25, 2008: Message edited by: pinky suresh ]
[ August 25, 2008: Message edited by: pinky suresh ]