PDA

View Full Version : Xml documnt reading problem in Chrome browser



manog
27 Mar 2012, 6:11 AM
I have problem in reading xml document file .
I get xml document file from ajax response ,like..

xmlDocument = response.responseXML;

var xmlElement = xmlDocument.documentElement.getElementsByTagName("xsd:element");

for (var i = 0; i < xmlElement.length ; i++)
{
var elementName = xmlElement[i].getAttribute("name");
}

It is working fine in firebox and IE but it is not working Google Chorme.
If i test like
alert(xmlElement .length);
It is return length of xml documrnt in firebox and IE.

but is return 0 in chrome browser.

What is the solution for this?.how can i read xml document in cross browser(firebox,IE and chrome)?
What i want to do for this?


Please reply me
by
Manog.

manog
27 Mar 2012, 6:21 AM
var xmlElement = xmlDocument.documentElement.getElementsByTagName("xsd:element");

It is woking firebox and IE but it is not working Chrome browser.

Solution:

It is working in Chrome if remove xsd from getElementsByTagName method

var xmlElement = xmlDocument.documentElement.getElementsByTagName("element");