【发布时间】:2015-07-17 21:36:21
【问题描述】:
我需要用ajax解析web服务返回的xml响应,这是我的代码,'response'是web服务返回的响应,我如何创建一个xml对象并解析它?
$.ajax({
type: 'POST',
url: 'web service link',
dataType: 'xml:lang',
success: function (response) {
// how to parse the response here
},
error: function (error) {
console.log(error);
}
});
这是我的 XML 代码:
<ArrayOfMobileConfiguration xmlns:xsd="w3.org/2001/XMLSchema"; xmlns:xsi="w3.org/2001/XMLSchema-instance"; xmlns="tempuri.org/">;
<MobileConfiguration>
<Id>1</Id>
<Key>STMaxDownloadSize</Key>
<Value>132000</Value>
</MobileConfiguration>
<MobileConfiguration>
<Id>2</Id>
<Key>ZoomingThresholdValue</Key>
<Value>14</Value>
</MobileConfiguration>
</ArrayOfMobileConfiguration>
【问题讨论】:
标签: javascript jquery ajax xml web