THIS CODE IS A WORK IN PROGRESS AND IS CHANGING FAST, PLEASE STAY TUNED OR USE THE LAST AVAILABLE "STABLE" VERSION FROM [http://code.google.com/p/fbjqry/] !
A wrapper library around Facebook's FBJS, which provides a jQuery-like interface for working with FBML (as much as possible).
FB = Facebook jqRY = jQuery RY = RockYou!
Code is based on jQuery 1.3.2 with some 1.4.2 goodies.
FBjqRY.fbjs module contains function for dealing with FBJS "DOM" nodes.
FBjqRY.isString for determining whether the argument is a String,
There is a
FBjqRY.fn.fbml function similar to
FBjqRY.fn.html for setting
FBML markup content into Facebook DOM nodes (based on
FBJS does only support regular nodes, thus don't ever expect comments or text nodes to be returned e.g. :
var cont = $('#header').contents(); // returns only nodes with a "tagName"
FBJS does not provide a reliable way to compare FB nodes, thus FBjqRY will generate ids for the accessed HTML (canvas) elements unless explicitly set !
FBJS only provides access to a limited set of attributes - thus custom element attributes or even some valid ones might not be accessible
FBML "normalizes" Your anchor's href values e.g. :
<!-- Your canvas "source" (FBML) : --> <a href="http://www.example.com"></a> <a href="#"></a> <!-- Becomes rendered as (HTML) : --> <a href="http://www.example.com/"></a> <a href="[YOUR_CANVAS_HOME_URL]/"></a>
array style access for FBjqRY ("jQuery") objects does not work, use
var $div = $('div'); // BAD - will be undefined cause of FBJS ! var $div = $('div').get(0); // OK
calling the FBjqRY function with arbitrary HTML won't work, some HTML types
are not supported by the parser e.g.
var $el = $('<button/>'); // FAILS
XHTMLize tags in Your HTML markup to be accepted by the XHTML parser :
var $el = $('<div/><hr/><br>'); // BAD - <br> is not valid XHTML ! var $el = $('<div/><hr/><br/>'); // OK - <br/> is valid XHTML
the XHTML parser does not allow inline style with opacity (set manually) :
var $el = $("<div id='main' style='opacity: 0.55;'/>"); // BAD - fails var $el = $("<div id='main'/>").css('opacity', '0.55'); // OK - works
FBjqRY.data() method does not trigger any handlers as jQuery does
For building/developing FBjqRY You'll need http://ringojs.org.
For building the project see the
Instructions for development setup might be found under test/README !
Code inspired by http://jquery.com, jQuery is licensed under MIT.
Authors: Nate McQuay, Antonin Hildebrand, Karol Bucek