tags:

views:

85

answers:

2

Hello

I'm trying to develop a small AJAX program.

XML I get from the server in responseXML.

<?xml version="1.0"?>
<serverResponse><resultaat>1</resultaat></serverResponse>

If I try to retrieve the "resultaat" node and its content using this code :

var serverResponse = mailObject.responseXML;
var resultaatXML = serverResponse.getElementsByTagName("resultaat");
alert(resultaatXML[0].childNodes[0].nodeValue);

Firefox alerts 1 And Internet Explorer alerts 'undefined'.

I'm really stuck at this. Can someone help?

Thx

A: 

Loading that XML into MSXML the code works fine. Try adding:-

alert(serverResponse.xml);

to see exactly what IE thinks is contained in the XML Document.

AnthonyWJones
A: 

Check out this question. Basically, IE requires doesn't automatically parse the XML, you have to explicitly tell it to. See this article for more.

Bialecki