解决方法如下: 复制代码 代码如下: xml转化成字符串 <BR>$(document).ready(function () { <br><br>//使fireFox也支持xmlDom.xml <BR>if (!document.all) { <BR>Node.prototype.__defineGetter__( <BR>"xml", <BR>function () { <BR>return (new XMLSerializer).serializeToString(this); <BR>}); <BR>} <BR>alert(1); <BR>var xmlStr = "<test>Hello world"; <BR>var parser = new DOMParser(); <BR>var xmlDoc = parser.parseFromString(xmlStr, "text/xml"); <BR>alert(xmlDoc.documentElement.nodeName); <BR>alert(xmlDoc.xml); <BR>}); <BR>