Facebook connect ifUserConnected() does not work - FB.Connect is undefined error
- by Arun
I'm trying to integrate Facebook connect to my website. The login button appears and i'm able to login. The profile picture and the name is displayed properly. However when I try adding the code FB.Connect.ifUserConnected, I get a error message saying FB.Connect is not defined.
This is what I'm doing
<div id="fb-root">
</div>
<script src="http://connect.facebook.net/en_US/all.js"></script>
<script type="text/javascript">
FB.init({ appId: 'my app id', status: true, cookie: true, xfbml: true });
</script>
<fb:login-button onlogin="fb_login()"></fb:login-button>
<script>
function fb_login() {
$("#SocialConnectButtons").hide();
$("#UserProfile").show();
FB.XFBML.Host.parseDomTree();
}
//ALL UNTIL HERE WORKS AS EXPECTED, BUT THE FOLLOWING LINE FAILS
FB.Connect.ifUserConnected(fb_login);
</script>
Thanks for the help