我有這樣一個XML字符串如下:?如何將XML節點轉換爲字符串?
str = "<myxml><Node id="1" attr1="a" attr2="b" />
<Node id="2" attr1="a" attr2="b" /><Node id="3" attr1="a" attr2="b" />
<Node id="4" attr1="a" attr2="b" /></myxml>"
function returnNodeAsStr(str) {
...
...
}
if(returnNodeAsStr(str) == '<Node id="1" attr1="a" attr2="b" />') {
alert("ok");
}
如何寫一個函數來獲取節點作爲字符串(使警報執行)
如果你是真正的使用jquery,看看這個線程:http://stackoverflow.com/questions/510995/parse-xml-response-with-jquery – JMax 2012-07-24 08:48:29