Jump to content

Regarding XML file reading


sujeeth_it

Recommended Posts

Hello all,I am writing a AJAX code for a functionality. I am getting the response from AJAX in XML content. I am using the following code to get the XML object.if (window.XMLHttpRequest){ req = new XMLHttpRequest(); if (req.overrideMimeType) { req.overrideMimeType('text/xml'); }} else if (window.ActiveXObject) { try { req = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { req = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {} }}And i am using [var doc = req.responseXML; ] code to get the XML response.and i am reading the content using childNodes like functions.Its working fine in IE but not working in Mozill FireFox.Please suggest me some alternative way for my objective.Please do help in this regard. :)

Link to comment
Share on other sites

In Firefox, when you click on Tools -> JavaScript Console, do any errors appear when you attempt to fetch and read the XML?When you set:

var doc = req.responseXML;

Has "doc" been assigned any data in Firefox? Is it that the data is not there? Or is the data there and you aren't able to read/parse it?I think we're going to need more information.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...