Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
58 lines (38 sloc) 1.06 KB

Facehugger

Wraps the Facebook Javascript SDK in a warm, loving, jQuery-ish embrace.

Download

jquery.facehugger.js

Usage

// Init

$.fb.init({ app_id: 'YOUR APP ID', status: true }, function() {
  
  $.fb
  
    // Status

    .status(function(response) {
      console.log(response);
    })

    .status('connected', function() { console.log('connected'); })
    .status('not_connected', function() { console.log('not connected'); })
    .status('unknown', function() { console.log('unknown'); })

    .status()

    // Login
  
    .login('publish_stream', function() {
      
      $.fb
    
        // API
    
        .api('/me', function(response) {
          console.log(response);
        })
    
        // Cached API
    
        .cachedAPI('/me', [ 'id', 'name' ], function(response) {
          console.log(response);
        })
    
        // Logout
    
        .logout(function() {
          console.log('logged out');
        });
    });
});
Something went wrong with that request. Please try again.