jQuery.parseXML()

parseXML: function(data, xml, tmp) {
 
    if (window.DOMParser) { //标准 IE9可以
        tmp = new DOMParser();
        xml = tmp.parseFromString(data, "text/xml");
    } else { // IE 
        xml = new ActiveXObject("Microsoft.XMLDOM");
        xml.async = "false";
        xml.loadXML(data);
    }
 
    tmp = xml.documentElement;
 
    if (!tmp || !tmp.nodeName || tmp.nodeName === "parsererror") {
        jQuery.error("Invalid XML: " + data);
    }
 
    return xml;
}
//link https://sites.google.com/a/van-steenbeek.net/archive/explorer_domparser_parsefromstring

你可能感兴趣的:(jquery)