public
Description: Prototype like open source Javascript libary for Facebook applications.
Homepage:
Clone URL: git://github.com/gdeglin/inigral-fbjs-library.git
100644 48 lines (33 sloc) 1.213 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
Usage examples:
 
Select Element
$('noelement');
 
Select 2 Elements
$('test1','test2');
 
Select elements by class
getElementsByClass('test2c')
 
Select elements by tag
getElementsByTagName('strike')
 
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') })
 
Check if an element is visible
$('test1').visible()
 
Hide an element
$('test1').hide()
 
Show an element
$('test1').show()
 
Toggle element visibility
$('test1').toggle();
 
Remove an element from the dom
$('test1').remove();
 
Get a hash of calculated element dimensions width/height as integers
$('test1').getDimensions()
 
Update remote
Update: function(target_element, response_type, action_path, callbacks, post_parameters)
(FBML/RAW)
Ajax.Update('test1', 'FBML', 'http://...',{ success: function(){} })
 
Load Remote
Load: function(response_type, action_path, callbacks, post_parameters)
(FBML/RAW/JSON)
Ajax.Load('JSON','http://...',{ success: function(result){console.log(result)} }, {'json':test_content})