"Uncaught SyntaxError: Unexpected token :" JSONP response
This question already has an answer here:
尝试:
function testJSONP(url) {
$.ajax({
url: url,
jsonp: "callback",
contentType: 'application/javascript',
dataType: "jsonp",
success: function (response) {
console.log(response);
}
});
}
这样写...
function testJSONP(url) {
$.getJSON(url,{},function(response){
console.log(response);
});
}
链接地址: http://www.djcxy.com/p/46026.html
上一篇: 以编程方式为跨度底部