[英]How to make fb:login-button as a plain text
I have implemented facebook login to my website. 我已经实现了Facebook登录到我的网站。 Now that, I want fb:login-button to be in a plain text format. 现在,我希望fb:login-button采用纯文本格式。 Is there any way to do it in polymer? 有什么办法可以在聚合物中做到这一点吗?
I want it to be like : 我希望它像:
<a href= "#" on-click="FB.customCheckLoginState();"> Sign in with Facebook </a>
Reference : https://github.com/davidwittenbrink/facebook-login/blob/master/facebook-login.html 参考: https : //github.com/davidwittenbrink/facebook-login/blob/master/facebook-login.html
The solution is pretty simple. 解决方案非常简单。 Found out the hard way - trial and error. 找出困难的方法-反复试验。
HTML : HTML:
<a href="#" on-click="fb_login">Sign in with facebook</a>
Polymer Script: 聚合脚本:
Polymer ({
is: 'facebook-login',
fb_login: function() {
FB.login( function( response ) {
FB.api( '/me', function( facebookResponse ) {
/* Do something here*/
});
}, { scope: 'public_profile,email,user_birthday' } );
},
ready: function() {
window.fbAsyncInit = function() {
FB.init({
appId: 'YOUR_APP_ID',
cookie : true,
xfbml: true,
version: 'v2.3'
});
};
if( typeof(FB) == 'undefined' ) {
( function( d, s, id ) {
var js, fjs = d.getElementsByTagName(s)[0];
if ( d.getElementById( id ) ) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js";
fjs.parentNode.insertBefore(js, fjs);
}( document, 'script', 'facebook-jssdk' ) );
}
},
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.