A simple JQuery plugin to assist with developing web applications using the Facebook JS SDK.
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
tests
README.md
jquery.facebook.js

README.md

jQuery Facebook Plugin v0.1

Plugin allows for quick and easy setup for the Facebook JS SDK within the jQuery wrapper.
Look at source for config options till I decide to write up a proper guide. ;)

Exposes useful information such as:
jQuery.facebook.inCanvas - Is page within FB Canvas.
jQuery.facebook.isReady - Can access window.FB.

Provides utility functions:
jQuery.facebook.ensure( callback [, waitForAuth] ) - Execute code only once FB has been included and initalised, also have the option to wait for user to be authenticaed before executing.
jQuery.facebook.context( canvasCallback, normalCallback ) - Execute certain code depending on whether your code is being run within the FB Canvas or normally.

Example Usage

jQuery.facebook( fbAppId [, settings] )

$.facebook(1234567890);

$.facebook(1234567890, {  
    locale: 'en_US',
    initConfig: {
        cookie: false,
        xfbml: true
    },
    initQueue: [function() {         
        console.log('1st');    
    }, function() {         
        console.log('2nd');    
    }, function() {         
        console.log('3rd');    
    }]
});

Contact