• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

AJAX request.responseXML

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please be sure to use UBB code tags when posting code to the forums. Unformatted code is extremely hard to read and many people that might be able to help you will just move along to posts that are easier to read. Please read this for more information.

You can go back and change your post to add code tags by clicking the .
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i have encountered similar problem in IE6, after hours of inspecting, here is the result I found.. hope this can help you

reply
    Bookmark Topic Watch Topic
  • New Topic