- Where Developers Learn, Share, & Build Careers
I am using JavaScript / jQuery that attempt to parse an XML document obtained through an AMX Has been doing. I can not post an XML document, but it is well-formed and the tag I see is present. AJAX requests succeed and gives full XML documents in both Chrome and Firefox - now I can not parse it for some reason. This code is working on Chrome, but Firefox or IE is not really I'm interested in IE
Type: "GET", Data Type: "application / xml", url: '../api/indica TorGroupSets.xml ', success: function (XML) {/ * Find indicator group set tags in XML file * / alert ($ (xml) .find (' indicator group asset '). Length); // This warning is available in Firefox' 0 'reads' 4' in Chrome / Firefox does not execute the following function: $ (xml) .find ('index group asset') .each (function () {/ * for each set, get name & Amp; id * / var groupSet = {name: $ (.) .attr ('name'), id: $ (this) .attr ('id')} warning (groupSet.name); // anything here not Only the warning and message alert / / alert (jqXHR + ':' + textStatus + ': if any error occurs, '+ ErrorThrown +' \ N An error has occurred, please refresh the page or contact the site administrator if the problem persists. ');}}); }
I was searching for solutions for most days, but everything is about the fact that a parser is not working in IE, much more on this issue in Firefox No.
I appreciate any input!
. It is my experience that jQuery can not cross XML in Firefox. It is possible that some unknown, specific circumstances trigger this behavior.
$ Get ("example.xml", function (data) {....}, "html"); If your document has a namespace, then it is necessary to cross the document using the local name property:
if (this.localName === "C: tag name") {....} It is possible to navigate the document using the common name functionality, if it does not have a name space: < Pre> if ($ (this) .is ("tagname")} {....} is very beautiful, but it is used. In Firefox, at least :)
Comments
Post a Comment