views:

122

answers:

1

Hi All,

I'm calling a webservice from javascript and then parsing the xml and rendering tables. All is well in firefox, but in IE its a different story.

The problem seems to be on this this line

var count = result.childNodes[0].getAttribute('Count');

Is there an IE friendly way to get an xml attribute in javascript?

the rest of the code works fine. but unfortunately i need that count.

A: 

This works in IE 7:

x=xmlDoc.getElementsByTagName("book")[0].attributes;
document.write(x.getNamedItem("category").nodeValue);

book is your element name and category is the name of the attribute. I found this example on W3Schools:

hoffmandirt