Problems parsing XML with jQuery in Firefox

tivvfgykpw

New Member
I'm using JavaScript/jQuery trying to parse an XML document that's been fetched via an AJAX Get request. I can't post the XML document, but it is well-formed and the tags that I'm looking for are present. The AJAX request is successful and returns the full XML document in both Chrome and Firefox--now I just can't parse it, for some reason. The code is working in Chrome but not Firefox or IE. I'm not really interested in IE right now, but I'm lost as to why it isn't working in Firefox. JavaScript: \[code\]window.onload = function getGroupSets() {$.ajax( { type: "GET", dataType: "application/xml", url: '../api/indicatorGroupSets.xml', success: function( xml ) { /*Find Indicator Group Set tags in XML file */ alert($(xml).find('indicatorGroupSet').length); //This alert reads '0' in Firefox, '4' in Chrome //The following function is not executed in Firefox: $( xml ).find( 'indicatorGroupSet' ).each( function( ) { /*For each Set, get the name & ID*/ var groupSet = { name: $( this ).attr( 'name' ), id: $( this ).attr( 'id' ) }; alert(groupSet.name); //Nothing displays here } ); }, error: function( jqXHR, textStatus, errorThrown ) { /*If an error occurs, alert the issue and a message to users */ alert( jqXHR + ':' + textStatus + ':' + errorThrown + '\nThere has been an error, please refresh the page or contact the site administrator if the problem persists.' ); }} );}\[/code\]I've been looking for solutions for most of the day, but everything seems to be about how a parser isn't working in IE, not much on this issue in Firefox. I appreciate any input!
 
Back
Top