我的 AJAX 调用是:
$.ajax({
method: "GET",
contentType: "application/json; charset=utf-8",
url: "http://localhost:8080/viewalldoctorprofile",
dataType: 'jsonp',
crossDomain: true,
success : function(json){
alert("24254");
},
error: function (xhr, ajaxOptions, thrownError) {
alert(xhr.status);
alert(thrownError);
}
});
我可以在浏览器中的检查元素中看到结果 JSON,但出现错误:
Error: jQuery111306513629604596645_1434294948077 was not called
请帮助我。预先感谢您
最佳答案
我假设“jQuery111306513629604596645_1434294948077”可能是您的 JSONP 响应的包装器 - 它是否正确包装在方法中,因为它应该是这样?
我可以看到你的ajax方法不包含'jsonpCallback'方法。这里你有一个类似的问题:Callback function for JSONP with JQuery ajax
关于jquery - 跨域ajax调用时出现 "Error: jQuery111306513629604596645_1434294948077 was not called"错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30831160/