admin管理员组文章数量:1435859
Basically, on my website I've added a login button for facebook, and the login works fine. However, you have to refresh once you've logged in to see that you're logged in. I've looked up the problem and the codes provided did not work.
Here is the code that I'm currently using in attempt to refresh the page after a successful login:
FB.Event.subscribe("auth.login", function(response) {
window.location.reload();
});
Although that should work, it doesn't; it's not even refreshing the page as specified in the code. Here's the code for the Facebook login button:
<fb:login-button perms="email,user_likes,user_photos">CONNECT Bla Bla</fb:login-button>
Could anybody please suggest some kind of fix as I've been working on this for many hours and it seems somewhat of an inconvenience for users to reload after a login.
Basically, on my website I've added a login button for facebook, and the login works fine. However, you have to refresh once you've logged in to see that you're logged in. I've looked up the problem and the codes provided did not work.
Here is the code that I'm currently using in attempt to refresh the page after a successful login:
FB.Event.subscribe("auth.login", function(response) {
window.location.reload();
});
Although that should work, it doesn't; it's not even refreshing the page as specified in the code. Here's the code for the Facebook login button:
<fb:login-button perms="email,user_likes,user_photos">CONNECT Bla Bla</fb:login-button>
Could anybody please suggest some kind of fix as I've been working on this for many hours and it seems somewhat of an inconvenience for users to reload after a login.
Share Improve this question asked Dec 29, 2013 at 18:35 JarrodJarrod 3321 gold badge3 silver badges14 bronze badges2 Answers
Reset to default 4Try this code for your FB login button
<fb:login-button scope="email,user_likes,user_photos" onlogin='window.location="http://yourdomain./yourpage.php";'>Connect with Facebook</fb:login-button>
For anybody that's still interested in an answer, for this, use the following code: Thanks to @Abhik Chakraborty for the base of the code.
<fb:login-button scope="email,user_likes,user_photos" onlogin='window.location.reload(true);'>Connect with Facebook</fb:login-button>
And that will then force your browser to reload the website (like a 'hard' reload).
本文标签: javascriptFacebook api does not reload after loginStack Overflow
版权声明:本文标题:javascript - Facebook api does not reload after login - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745669679a2669497.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论