未定义 facebook 错误函数响应
facebook error function response is not defined
if (response.status === 'connected') {
$.ajax({
url: 'https://graph.facebook.com/oauth/access_token',
type: 'GET',
data:'grant_type=fb_exchange_token&client_id="done"&client_secret="done"&fb_exchange_token="done"',
success: (function (response) { alert(reponse); })
}); testAPI();
}
我的 ajax 查询成功传递数据:url:但函数响应出错
Uncaught ReferenceError: reponse is not defined
$.ajax.success
c.extend.ajax.w.onreadystatechange
也许您应该使用 response
变量而不是未定义的 reponse
:
if (response.status === 'connected') {
$.ajax({
url: 'https://graph.facebook.com/oauth/access_token?grant_type=fb_exchange_token&client_id={APP_ID}&client_secret={APP_SECRET}&fb_exchange_token={ACCESS_TOKEN}',
type: 'GET'
success: function (response) {
alert(response);
}
});
testAPI();
}
此外,请修复您的呼叫,因为您发送的请求不正确。此外,将 {}
之间的值替换为实际值。
if (response.status === 'connected') {
$.ajax({
url: 'https://graph.facebook.com/oauth/access_token',
type: 'GET',
data:'grant_type=fb_exchange_token&client_id="done"&client_secret="done"&fb_exchange_token="done"',
success: (function (response) { alert(reponse); })
}); testAPI();
}
我的 ajax 查询成功传递数据:url:但函数响应出错
Uncaught ReferenceError: reponse is not defined
$.ajax.success
c.extend.ajax.w.onreadystatechange
也许您应该使用 response
变量而不是未定义的 reponse
:
if (response.status === 'connected') {
$.ajax({
url: 'https://graph.facebook.com/oauth/access_token?grant_type=fb_exchange_token&client_id={APP_ID}&client_secret={APP_SECRET}&fb_exchange_token={ACCESS_TOKEN}',
type: 'GET'
success: function (response) {
alert(response);
}
});
testAPI();
}
此外,请修复您的呼叫,因为您发送的请求不正确。此外,将 {}
之间的值替换为实际值。