GLOBAL INDEX  |  FRAMES  |  NO FRAMES
Library: facebook
Overview
Library for building facebook apps.
Importing facebook will automatically make all known FBML tags available as functional HTML tags, with : replaced with _. For example, the you can create a FB:FRIEND-SELECTOR tag by calling FB_FRIEND_SELECTOR(). See: http://wiki.developers.facebook.com/index.php/Category:FBML_tags
source: facebook.js
Functions
fb.redirect(url)
Tells facebook to redirect the user to a new URL. For FBML facebook apps, use this instead of response.redirect(), so that it redirects the facebook user instead of the facebook server.
parameters
string url? The new URL to direct the user to. If you do not set this parameter, the user will be redirected to the main canvas page.
fb.requireAdd()
Ensures that the current user has added this app. If the current user of the app has already added it, this does nothing. Otherwise, it immediately redirects the user to the add page.
fb.init()
Every facebook app should call fb.init() immediately after import("facebook"). It will first make sure the AppJet app is configured as a valid facebook app. Next, if the request path starts with "/callback/", it will authenticate that the request from facebook and then set up all the fb.* properties.
fb.call(cmd, params)
Executes a remote facebook API call. See the Facebok API Methods wiki page for a list of all methods.
parameters
string cmd The name of the command, e.g. "facebook.profile.setFBML".
object params The set of parameters to pass to this call. Note: api_key, sesion_key, call_id, v, and format, and sig will be automatically set for you. However, you can override any of these if you like.
returns
object The call result, as a javascript object.
examples
fb.requireAdd();
print(fb.call("users.getInfo",
              { uids: [700577, 550505927],
                fields: ["birthday", "about_me"] }));
fb.sendNotification(users, notificationFBML)
Convenience function for sending a notification to 1 or more users. See: Facebook's docs for facebook.notifications.send.
parameters
array or string users Array of uids or single uid of those to receive this notification.
string notificationFBML The FBML content of the notification.
fb.setProfileFBML(uid, markup)
Convenience function for setting a user's profile FBML. See Facebook's docs for facebook.profile.setFBML.
parameters
string uid The uid of the profile to set.
string markup The text of the FBML to set.
examples
fb.requireAdd();
fb.setProfileFBML(fb.uid,
    DIV(CENTER(
        "Here is another picture of me:",
        BR(),
        FB_PROFILE_PIC({uid: fb.uid}))));
fb.authenticateRequest()
Checks post parameters against fb_sig to verify that the reqest came from facebook servers and not a haxxor. Note: this method is called automatically by fb.init(), so you usually do not need to call it directly.
returns
boolean true if the request is from facebook and legit; false otherwise.
Objects
object
fb
The FaceBook object.
string
fb.uid
The facebook uid of the current user of this app.
string
fb.sessionKey
The current facebook sessionKey. This will only be set if the session user has added the app and is logged in to it. Otherwise, it will be undefined.
array[string]
fb.friends
List of the uids of the current user's friends. This will only be filled in if the session user has added the app and is logged in to it.
string
fb.fullCanvasUrl
contains "http://apps.facebook.com/<the_canvasl_url>/"
Generated by JsDoc Toolkit 1.3.3 on Thu, 03 Jul 2008 01:27:44 GMT.