【发布时间】:2014-05-22 12:38:47
【问题描述】:
function getInfo()
{
var URL="https://api-oauth2.mendeley.com/oauth/authorize?client_id=374&redirect_uri=https://localhost/api/mendeley/mendeley.php&response_type=code&scope=all&JSON=1";
$.ajax({
url: URL,
type: 'get',
dataType: "jsonp",
jsonpCallback: "https://192.168.2.210/api/mendeley/mendeley.php",
converters: {
'text json': true
},
success: function (data) {
console.log(data.content);
},
error: function(e) {
console.log(e);
}
});
}
当我调用这个函数时,这给了我错误
SyntaxError:语法错误
【问题讨论】:
-
您在哪一行得到错误?是
syntax error还是cross origin error? -
如果我把警报放在错误中:function(e){} 它会给我那个警报
标签: ajax cross-domain mendeley