我有以下用jsfiddle制作的例子,它在Firefox6和chrome中工作得很好,但在IE8中不行。如何解决此问题?
var xml = "<Response> <isSuccess>true</isSuccess> <operation>viewall</operation> <message>No configurations were found for this project</message></Response>";
alert($(xml).find('message').text());发布于 2011-08-18 16:59:20
您需要使用.parseXML
var xml = "<Response> <isSuccess>true</isSuccess> <operation>viewall</operation> <message>No configurations were found for this project</message></Response>";
xmlDoc = $.parseXML( xml ),
$xml = $( xmlDoc ),
$title = $xml.find( "message" ).text();
alert($title);这里是fiddle
https://stackoverflow.com/questions/7104779
复制相似问题