我正在尝试学习如何从 Facebook 为我的应用程序获取应用程序访问令牌。
我正在根据此处指定的数据( http://developers.facebook.com/docs/authentication/#client_credentials )发送一个 jquery 请求(在 firebug 控制台中)。
我似乎得到了响应( access_token = 'my_app_id|'+the_app_token )但萤火虫发送一个错误=>'我得到的响应'+'未定义'。感觉我在这里遗漏了一些非常简单的东西?如何避免此错误并获得响应?
params = {};
params['grant_type']= 'client_credentials'
params['client_id'] =app_id;
params['client_secret'] = client_secret;
$.ajax({
url: 'https://graph.facebook.com/oauth/access_token',
type:'GET',
dataType: 'jsonp',
data:params,
success: function(response){
resp = response;
}
});