Getting Started with the JavaScript Library
From Facebook Developer Wiki
Facebook Connect sites use the JavaScript Client Library to access Facebook Platform via JavaScript. Here are some tips to help you get started.
- To use the Facebook Platform REST API with Connect, use the FB.ApiClient class.
Note: Not all API methods are supported. Which methods you can use depend on whether or not you're using a session secret (which you get when you create an application with the Facebook Developer application -- see Trying Out Facebook Connect for details). If you're not using an application secret, you can't use admin methods or methods that set data on a profile (like profile.setFBML).
- To log users in, use FB.Connect.requireSession.
Note: If you're having your users log in via fb:login-button, Facebook verifies the session for you, so you don't need to call this function. Read more about logging in users.
- To invite users to connect with their friends, call FB.Connect.inviteConnectUsers.
- To determine the user's Facebook Connect state (whether the user has authorized your site, and if so, whether the user is logged in or has connected accounts), use FB.ConnectState -- which describes the user's Connect state (used in connect.getStatus).
- For XFBML, you can manage XFBML elements with FB.XFBML.Host.
- To create XFBML elements without using XFBML tags, use FB.XFBML.Host.AddElement and FB.XFBML.Host.AddElements.
Other elements in the XFBML namespace are similar to the XFBML tags.
