开发者

Facebook API login button without using FB.Login() (i.e. no pop-up)

I'm creating a Facebook App and wanted to avoid firing off the Allow box, but it looks like I'm going to have to do that.

One option could be to call FB.Login(), but that generates a pop-up t开发者_运维技巧hat will probably be blocked by the user.

Another option is to just use FBML:

<fb:login-button></fb:login-button>

When a user clicks on this button, a window opens that appears to be a pop-up but isn't (i.e. it's not blocked). This would then be ideal.

The question now is how can I launch that window that opens without having to have the user click that button? I'd like to not have that button show, but would like it's clicked state to show.

Is there any way I can auto-click that button?

Thanks.


If the user can interact with it you can too in javascript, so long as it's not an alert box or one of it's ilk (cos those would spawn out to the system to be handled, no longer in the domain of the DOM).

So why not call the onclick of that button?


I am using plain anchor tag using this link: It works!! https://graph.facebook.com/oauth/authorize?client_id=&redirect_uri=&scope=email,user_birthday,user_about_me,user_location


How are you initiating the FB.login?

If you just call it with JS it will be blocked. If you initiate it with an interaction i.e. a click it won't get blocked by popup blockers.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜