Facebook SDK:替换“登录”按钮与自定义图像 [英] Facebook SDK: Replace "Log In" button with custom image
本文介绍了Facebook SDK:替换“登录”按钮与自定义图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有页面选项卡应用程序,其中有一个登录页面与登录按钮,供用户点击安装应用程序。我可以用自定义图像替换登录按钮吗?
I have Page Tab App, which has a landing page with a "Log In" button for users to click to install the App. Can I replace the "Log In" button with my custom image?
登录按钮的当前代码是:
The current code for the "Log In" button is :
<div class="fb-login-button" data-scope="friend_likes"></div>
推荐答案
您可以使用JS Api进行此操作, p>
You can use the JS Api for this,
function fbAuth() {
FB.login(function(response) {
if (response.authResponse) {
alert('User fully authorize the app.');
} else {
alert('User canceled login or did not fully authorize the app.');
}
}, { scope: 'friend_likes' });
}
那么您可以使用onclick事件在自定义按钮中调用它:
then you can call it in a custom button with the onclick event:
<a href="#" onclick="return fbAuth();">Login</a>
Facebook文档: FB.login
Facebook Documentation: FB.login
这篇关于Facebook SDK:替换“登录”按钮与自定义图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文