type = 'calci';
var ajurl = "example.com&callback=mycallback";
var datas = "cateid=" + cateid + "&type=" + type + "&pno=" + pno + "&whos=" + whos;
$.ajax({
type: "GET",
url: ajurl,
data: datas,
contentType: "application/json; charset=utf-8;",
dataType: "jsonp",
jsonp: 'callback',
username: "abcdxyz",
password: "lkjljlmkjhlkj",
success: function(data) {
alert('success...');
console.log(data);
},
jsonpCallback: 'mycallback',
error: function(xhr, ajaxOptions alert(xhr.status); alert(thrownError);
}
});
我定义了回叫功能
function mycallback(jsondata){
console.log(jsondata+"CHeck");
$('#calcilist').html(jsondata);
}
如果我打印错误,则表示未定义回调函数或未调用queryasjdkbaskjds1298372981379284-2132。
答案 0 :(得分:0)
尝试将&callback=mycallback
更改为&callback=?
或将其删除并从
jsonp: 'callback',
到
jsonp: false,