我正在通过 facebook 的 Javascript SDK 将用户登录到一个网站。用户单击“通过 fb 登录”按钮后,我想根据用户在 facebook 的确认中单击“确定”还是“取消”来生成不同的响应。这是我在他们单击 fb 按钮时使用的代码。
$("#fb").click(function() {
FB.login(function(response){
FB.api('/me',function(response){
// I believe the test to see if they are logged in or not should go here
});//FB.api
},{scope:'publish_actions, email, user_likes, user_location'});
});
任何建议表示赞赏。谢谢!