在<div class =“fb-login-button”> </div>中指定重定向网址onlogin

时间:2012-05-26 06:59:18

标签: facebook fbconnect

这就是我通常在fbml f-connect标签中指定重定向网址的方式

<fb:login-button onlogin='redirect-url'>f-connect</fb:login-button>

如何在登录时指定重定向网址:

<div class="fb-login-button">f-connect</div> ??

1 个答案:

答案 0 :(得分:8)

你现在就这样做了。由于登录按钮没有任何redirect_uri,您需要FB.Event.subscribe auth.authResponseChange事件才能知道用户已登录:

FB.Event.subscribe('auth.authResponseChange', function(response) {
  if (response.status === 'connected') {
    window.top.location = '//redirect-url.com';
  }
});