Posted in Javascript onDecember 09, 2011
解决方法如下:
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>xml转化成字符串</title> <script src="Scripts/jquery-1.4.1.js" type="text/javascript"></script> <script language="javascript" type="text/javascript"> $(document).ready(function () { //使fireFox也支持xmlDom.xml if (!document.all) { Node.prototype.__defineGetter__( "xml", function () { return (new XMLSerializer).serializeToString(this); }); } alert(1); var xmlStr = "<test>Hello world</test>"; var parser = new DOMParser(); var xmlDoc = parser.parseFromString(xmlStr, "text/xml"); alert(xmlDoc.documentElement.nodeName); alert(xmlDoc.xml); }); </script> </head> <body> </body> </html>
FireFox下XML对象转化成字符串的解决方法
声明:登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述。
Reply on: @reply_date@
@reply_contents@