Facebook 脚本没有错误,但仍未显示结果
我对 Facebook Javascript API 非常陌生。我需要帮助才能根据我创建的好友列表获取好友列表。比如“毕业生、学校、朋友、共事者”(所有这些都是自己创建的)。
这是到目前为止我所做的。我已成功登录并为该会话分配了正确的 access_token。之后我运行这个。
FB.login(function(response) {
if( response.session ){
*FB.api('friendlist', '/me/friendlists', function(){
**alert('got the friendlist');
});
}else{
alert('User not logged in.');
}
},{scope: 'email,read_friendlists'});
在此代码上
* 运行正常,没有任何异常?
** 此警报从不调用?
只是想问几件事。
有没有正确的方法来查看异常。如果我们也有异常回调?
以及如何使用 JS API 从 FB 获取 FriendList 列表。
谢谢,
塔尔哈·艾哈迈德·汗
I am very new to FaceBook Javascript API. I need help to get the fiends list according to the Friend List i have created. Like 'Grads, School, Friends, Worked with' (All of these are self created).
This is so far I have done right now. I am successfully logged in and have proper access_token allocated to this session. After that I run this.
FB.login(function(response) {
if( response.session ){
*FB.api('friendlist', '/me/friendlists', function(){
**alert('got the friendlist');
});
}else{
alert('User not logged in.');
}
},{scope: 'email,read_friendlists'});
On this code
* this runs OK without any exceptions?
** this alert never invokes?
Just want to ask few things.
Is there a proper way to see the exception. If we have a callback for exception as well?
and How to get the List of FriendList from FB using JS API.
Thanks,
Talha Ahmed khan
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我已经尝试过了,它似乎有效。
您可以在
https:// Developers.facebook.com/tools/console/
I've tried this and it seems to work
You can test a lot of this stuff out at
https://developers.facebook.com/tools/console/
根据文档,FB.api 返回一个响应对象,您可以使用它来调试错误。
https://developers.facebook.com/docs/reference/javascript/FB。 api/
修改后的代码:
如果您想查看“响应”上有哪些属性,您可以使用 firebug 或 chrome 的调试控制台之类的东西,而不是:
您可以使用
According to the documentation, FB.api returns a response object which you can use to debug the error.
https://developers.facebook.com/docs/reference/javascript/FB.api/
revised code:
if you want to see what properties are on 'response', you could use something like firebug or chrome's debug console and instead of:
you could use