Facebook connect ifUserConnected() does not work - FB.Connect is undefined error

Posted by Arun on Stack Overflow See other posts from Stack Overflow or by Arun
Published on 2010-05-11T12:27:19Z Indexed on 2010/05/18 11:10 UTC
Read the original article Hit count: 631

Filed under:
|

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

© Stack Overflow or respective owner

Related posts about facebook

Related posts about facebook-connect