So I'm passing XML to a PHP file. Things work great in non-IE browsers, and things work great in IE8 and IE11, but not in 9 and 10.
The culprit, I'm betting, is that first "if" condition in the stringIt function below. What I don't know is why exactly it works for 8 and 11 but not 9 and 10, and more importantly, what should I be doing instead to deal with all four versions.
Any help is greatly appreciated.
function stringIt($xml) {
var doc = $xml[0],
string;
if(window.ActiveXObject) { alert('activeX'); string = doc.xml; }
else { string = (new XMLSerializer()).serializeToString(doc); }
return string;
}
EDIT : Here's the solution I ended up using. Thanks again for that link tjb.
function stringIt($xml) {
var doc = $xml[0],
string;
if(window.ActiveXObject) { alert('activeX'); string = doc.xml; }
else { string = (new XMLSerializer()).serializeToString(doc); }
if(string == null) {string = (new XMLSerializer()).serializeToString(doc);}
return string;
}