JavaScript XML和string相互转化实现代码
代码如下: //convert string to xml object function String2XML(xmlString) { // for IE if (window.ActiveXObject) { var xmlobject = new ActiveXObject(“Microsoft.XMLDOM”); xmlobject.async = “false”; xmlobject.loadXML(xmlstring); return xmlobject; } // for other browsers else { var parser = new DOMParser(); v
用户评论