Reputation: 41
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.
Upvotes: 1
Views: 1543
Reputation: 6810
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:
Upvotes: 1