0

我正在尝试在我的页面上集成 Facebook登录按钮评论插件

我让他们分开工作,当有人通过登录按钮登录时,评论插件会响应(并将用户登录),但我的问题是相反的;当有人通过评论插件登录发表评论时,没有事件可以从评论插件传递到登录按钮。

有没有办法解决?

谢谢,

4

1 回答 1

1

您应该在评论中注册一个 FB javascript 事件,或者最好先登录。当用户通过点赞或评论操作登录时,应触发登录事件:

    window.fbAsyncInit = function() {
                FB.init({
                    appId   : 'xxxx',
                    status  : true, // check login status
                    cookie  : true, // enable cookies to allow the server to access the session
                    xfbml   : true // parse XFBML
                }); 
   FB.Event.subscribe('auth.login', function() { 

                      /*create a reload in wich you login the user, because now you have the cookie. Or via ajax */
             });
}
于 2012-07-31T16:29:11.660 回答