2
我試圖激活jQuery.ajax()來獲取XML服務器響應時,遇到了錯誤是:嘗試使用jQuery.ajax與使用JSONP,我收到以下錯誤要求JSONP
return $.ajax({
type: 'GET',
url: this.AgentServiceUrl + "/" + methodName,
async: false,
jsonpCallback: 'jsonCallback',
contentType: "text/xml",
dataType: 'jsonp',
success: function (json) {
console.dir(json.sites);
},
error: function (e) {
console.log(e.message);
}
});
,我從服務器獲取的響應是:
HTTP/1.1 200 OK
Cache-Control: private, max-age=0
Content-Length: 114
Content-Type: text/xml; charset=utf-8
Server: Microsoft-IIS/7.5
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Wed, 19 Jun 2013 08:43:13 GMT
<?xml version="1.0" encoding="utf-8"?>
<string xmlns="http://CosmoCom.com/WebServices/TCWS/Agent">010001</string>
我能做些什麼?
我有同樣的問題...我必須使用ajax JSONP發送POST請求,只能取回XML ...問題是它給出一個parsererror – natiz