Redirect after clicking on the Facebook login button, even if already logged in Facebook -
i have standard facebook login button on homepage , don't want people automatically log site facebook account, if user clicks login button.
if user not logged in facebook, popup appear asking him credentials , redirected loggedin.html
after that.
<div id="fb-root"></div> <fb:login-button perms="email"></fb:login-button> <script> window.fbasyncinit = function() { fb.init({ appid : 'xxxxxxxxxxxx', status : true, cookie : true, xfbml : true }); fb.event.subscribe('auth.login', function() { window.location = "loggedin.html"; }); }; (function() { var e = document.createelement('script'); e.src = document.location.protocol + '//connect.facebook.net/en_us/all.js'; e.async = true; document.getelementbyid('fb-root').appendchild(e); }()); </script>
if user logged in facebook, when clicks button popup appear , disappear right away, ok that. user not redirected loggedin.html
. how can ?
i had same problem. solved using regular link instead of thingy , adding click handler href facebook fb.login javascript function
http://developers.facebook.com/docs/reference/javascript/fb.login/
within different responses handle corresponding ajax things.
Comments
Post a Comment