执行ajax时,调用其返回的JSON数据,但未调用成功函数。我的ajax功能代码如下:
var lsUrl= "my service api address";
$.ajax({
url: lsUrl,
type: "GET",
crossDomain: true,
dataType: "jsonp", // from the server
async: false,
contentType: "application/json; charset=utf-8", // to the server
ProcessData: true,
success: function (success) {//my success operation code }error:function(error){}});
//**In above code the service api link returns json data.i got json data properly but its not return to success function.i get following error :**
200 parsererror jQuery111209869910120032728_1443011402050未被调用。
如何解决此问题?
答案 0 :(得分:0)
使用application / javascript作为内容类型。
contentType: "application/javascript; charset=utf-8"