sajesh Nambiar
sajesh Nambiar

Reputation: 699

Unable to parse XML in Chrome

The below code does not run in Chrome.

function parseXML(xmlstring) {
var dom;
if (window.ActiveXObject && window.GetObject) { 
dom = new ActiveXObject('Microsoft.XMLDOM');
dom.loadXML(xmlstring);
return dom;
}
if (window.DOMParser) {
var xmlDoc = new window.XMLHttpRequest(); 
xmlDoc.open("GET", xmlstring, false);
xmlDoc.overrideMimeType('text/xml');
xmlDoc.onreadystatechange = function () {
if (xmlDoc.readyState == 4 && xmlDoc.status == 200) {
dom = xmlDoc.responseXML;
return dom;
}
};
xmlDoc.send("");
//return new DOMParser().parseFromString((xmlstring), 'text/xml');

} } I tried all posibility even used $.parseXML but did not work in Chrome Your valuable input will be highly appreciated.

Upvotes: 0

Views: 937

Answers (1)

sajesh Nambiar
sajesh Nambiar

Reputation: 699

i got the dom properly but i was doing $(dom).find('') instead of $(dom.find(" ") dont know why this strange behavior in Chrome...Now it works in all browser...[:)]

Upvotes: 1

Related Questions