Facebook Connect integration in simple way

To implement Facebook Connect. First make sure to create the application profile inside Facebook Developer because we will need the API key for our site later on. Complete it and copy the generated API key.

Facebook Connect implementation in web consists of two parts; which it was on header and footer. As for header, you’ll need to insert these two lines of codes.

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml">
<script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php/en_US" type="text/javascript"></script>

And for footer, apply this code

<script type="text/javascript">
    FB.init("API KEY HERE", "xd_receiver.htm");
    FB.ensureInit(function() {
        if(FB.Connect.get_loggedInUser() != null){
            var param = {action: "facebooklogin", uid: FB.Connect.get_loggedInUser()};
            // ajax request for login
                //if true redirect else register
                if(data == "true"){
                }else if(data == "false"){
                    alert("Technical Error.");

One thought on “Facebook Connect integration in simple way

  1. Rachele Lodeiro

    Good day! I just wish to give an enormous thumbs up for the great data you may have right here on this post. I will be coming again to your blog for extra soon.

Leave a Reply

Your email address will not be published. Required fields are marked *