在对SOAP ui接口进行AJAX调用后,我无法从收到的响应中解析元素
AJAX呼叫:
$.ajax({
type:"POST",
url:myURL,
async:false,
contentType: "text/xml",
dataType: 'xml',
data: msgXML,
success: function(result) {
debugger;
console.log('success');
console.log(result);
json = result;
//I would like to parse the object here
},
error:function(data){
console.log(data.responseText);
debugger;
}
});
我在Google chrome调试器中得到以下对象
我知道这是一个菜鸟问题,但我无法以某种方式解析该对象内部的内容。
谢谢!
答案 0 :(得分:0)
找到了!
要解析数据,只需执行以下操作:
result.getElementsByTagName("nameOfTheTagIWantToFind")[0]
干杯!