FBJS (Facebook Javascript) Library Based on Prototype
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


This is an FB Javascript library designed to extend the available methods available to Facebook canvas page applications. It is loosely based on the Prototype javascript library.

Usage examples (View source to see more):

Select Element

Select 2 Elements

Select elements by name

Select elements by class

Select elements by tag

Check if an element is visible

Hide an element

Show an element

Toggle element visibility

Remove an element from the dom

Get a hash of calculated element dimensions width/height as integers

Update remote
Update: function(target_element, response_type, action_path, callbacks, post_parameters)
Ajax.Update('test1', 'FBML', 'http://...',{ success: function(){} })

Load Remote
Load: function(response_type, action_path, callbacks, post_parameters)
Ajax.Load('JSON','http://...',{ success: function(result){console.log(result)} }, {'json':test_content})

Pop up a confirmation Facebook dialog. Executes 'callback' if the user confirms.
confirm("Confirm action?", "Do you really want to do this?", function() { doIt(); })

Use Javascript version of .map
['a2','b2'].toSource() == map(['a','b'], function(val) { return val+2 }).toSource()

Recurse through the dom under a selected element and return nodes for which test is true as an array
collect($('test1'), function(element){ return (element.getClassName() == 'test2c') })