Jump to content
Sign in to follow this  
sujeeth_it

Regarding XML file reading

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. :)

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...