jQuery (2.x), xml, IE 11 vs FF, most properties remain undefined

please see this javascript I am trying to get working on IE 11, which works fine on FF and IE 8 (the only browsers I have to test ...)

var setting = {};
setting["test"] = "x";

var xml = "<data><popup_args><id>123</id></popup_args><popup_form>456</popup_form></data>";

try
{
  var xmlDoc = $.parseXML(xml);
}
catch(err) {
    alert(err);
}


$jxml = $(xmlDoc);
$axml = $jxml.find("data");

alert($axml.length); 
        // get the data for the form
$cxml =$axml.children("*");

$cxml.each( function(index, value) {
            var pattern = /^popup/;
            alert( value.tagName  ); 
            alert( value.innerHTML ); 

            if (pattern.test( value.tagName )) {
              //alert( $(this)[0].innerXHTML ); 
              setting[  value.tagName ] = value.innerHTML;
            }
        });

alert("result:" + JSON.stringify(setting) );

Open in new window


the alert on innerHTML return "undefined", the same if I try to use html or html() or text etc.
I tried to go other techniques (xml2json like this one http://goessner.net/download/prj/jsonxml/), all to no avail ...

what am I missing here, I presume it must be something small/stupid
LVL 143
Guy Hengel [angelIII / a3]Billing EngineerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Alexandre SimõesManager / Technology SpecialistCommented:
A quick way to fix it is to use $(value).text() instead.
jQuery will take care of the fallbacks.

Here's a sample that woks everywhere for me: http://jsfiddle.net/AlexCode/1qnzay1v/

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Guy Hengel [angelIII / a3]Billing EngineerAuthor Commented:
looks like I was just doing overkill ...
here the script that works just fine, after also doing a step back and changing the XML
var setting = {};

var xml = "<data><popup id=\"args\"><id>123</id></popup><popup id=\"form\">456</popup></data>";

$jxml = $(xml);

        // get the data for the form
$cxml =$jxml.children("popup[id]");
//alert($cxml.length); 

$cxml.map( function(index, value) {
    	 //alert(  JSON.stringify(value));
            //alert(  $(value).attr("id") ); 
            //alert( $(value).html() ); 
            setting[ "popup_" + $(value).attr("id") ] = $(value).html() ;
        });

alert("result:" + JSON.stringify(setting) );

Open in new window

Guy Hengel [angelIII / a3]Billing EngineerAuthor Commented:
the suggestion basically got me to think about doing it pure jquery, and by doing a step back about the xml structure also.
thanks
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
jQuery

From novice to tech pro — start learning today.