fb login popup block

前端 未结 4 1659
失恋的感觉
失恋的感觉 2020-12-13 04:31

I am making using fb login feature but problem comming to me is that whenever I click on the fb login button before page media loading is completed, it blocks the popup for

4条回答
  •  有刺的猬
    2020-12-13 05:32

    You cannot call FB.login from the callback of FB.getLoginStatus.

    Browsers tend to block popup windows of the popup is not spawned as an immediate result of a user's click action.

    Because FB.getLoginStatus does an ajax call and you call FB.login on it's response, the popup that would open as a result of this call is blocked.

    A solution to your problem would be to call FB.getLoginStatus on page load and use the response inside your fb_login() method.

提交回复
热议问题