我一直在尝试将facebook登录添加到我的页面。我使用以下脚本在我的页面上放置了facebook登录按钮:
<script src="http://connect.facebook.net/en_US/all.js">
</script>
<script>
FB.init({
appId:'<?php echo APP_ID;?>', cookie:true,
status:true, xfbml:true
});
</script>
<fb:login-button perms="email,user_checkins">
Login with Facebook
</fb:login-button>它还显示了登录按钮。同时点击它也会打开facebook的登录屏幕。
成功登录后,弹出框将关闭,而不会刷新父页面。
我遗漏了什么?
发布于 2011-02-20 18:26:36
您没有要求页面在成功登录后刷新:
// whenever the user logs in, we refresh the page
FB.Event.subscribe('auth.login', function() {
window.location.reload();
});有关详细信息,请参阅PHP-SDK example。
发布于 2012-07-24 15:24:53
两个很好的解决方案
// whenever the user logs in, we refresh the page});`
<fb:login-button onlogin="LoginFunction()" perms="email,user_likes,user_photos">CONNECT Bla Bla</fb:login-button>(‘auth.login’,FB.Event.subscribe(){ window.location.reload();auth.login
当用户登录时,我们调用函数LoginFunction(),然后我们可以做任何事情,比如刷新或重定向用户。
https://stackoverflow.com/questions/5056356
复制相似问题