Facebook Developers
DocsToolsSupportNewsApps
Log In
  • Social Plugins
  • Facebook Login
  • Open Graph
  • Facebook APIs
  • Games
  • Payments
  • App Center
  • Promote Your App
  • iOS
  • Android
  • JavaScript
    • Getting Started
    • How-Tos
    • Reference
  • PHP
  • More SDKs
  • Core Methods
    • FB.api
    • FB.init
    • FB.ui
  • Auth Methods
    • FB.getAuthResponse
    • FB.getLoginStatus
    • FB.login
    • FB.logout
  • Event Handling
    • FB.Event.subscribe
    • FB.Event.unsubscribe
  • XFBML
    • FB.XFBML.parse
  • Canvas Methods
    • FB.Canvas.Prefetcher.addStaticResource
    • FB.Canvas.Prefetcher.setCollectionMode
    • FB.Canvas.hideFlashElement
    • FB.Canvas.scrollTo
    • FB.Canvas.setAutoGrow
    • FB.Canvas.setDoneLoading
    • FB.Canvas.setSize
    • FB.Canvas.setUrlHandler
    • FB.Canvas.showFlashElement
    • FB.Canvas.startTimer
    • FB.Canvas.stopTimer

JavaScript SDK Reference

JavaScript › JavaScript SDK Reference

Methods

  • Core Methods
  • Auth Methods
  • Event Handling
  • XFBML
  • Canvas Methods

Core Methods

FB.api

Make an API call to the Graph API.

FB.init

Initialize the library.

FB.ui

Method for triggering Dialogs as popups, modal dialogs or as full pages. The dialogs are automatically formatted for mobile or desktop based on the client.


Auth Methods

FB.getAuthResponse

Synchronous accessor for the current authResponse.

FB.getLoginStatus

Find out the current status from the server, and get a session if the user is connected.

FB.login

Login/Authorize/Permissions.

FB.logout

Logout the user in the background.


Event Handling

FB.Event.subscribe

Subscribe to a given event name, invoking your callback function whenever the event is fired.

FB.Event.unsubscribe

Removes subscribers, inverse of FB.Event.subscribe.


XFBML

FB.XFBML.parse

Parse and render XFBML markup in the document.


Canvas Methods

FB.Canvas.Prefetcher.addStaticResource

Controls which static resources are flushed to the browser early.

FB.Canvas.Prefetcher.setCollectionMode

Controls how statistics are collected on resources used by your application, with the intent to influence whether those resources will be fetched to the browser early, or to turn off Prefetching completely.

FB.Canvas.hideFlashElement

Hides a Flash Element, used in conjunction with hideFlashCallback.

FB.Canvas.scrollTo

Tells Facebook to scroll to a specific location in the iframe of your canvas page.

FB.Canvas.setAutoGrow

Starts or stops a timer which resizes your iframe every few milliseconds.

FB.Canvas.setDoneLoading

Reports that the page is now usable by the user, for collecting performance metrics.

FB.Canvas.setSize

Tells Facebook to resize your iframe.

FB.Canvas.setUrlHandler

Registers the callback for inline processing (i.e. without page reload) of user actions, such as clicks on Live Ticker game stories.

FB.Canvas.showFlashElement

Display a Flash Element, used in conjunction with hideFlashCallback.

FB.Canvas.startTimer

When using setDoneLoading, controls the page load timer.

FB.Canvas.stopTimer

When using setDoneLoading, controls the page load timer.

Updated 14 hours ago
Facebook © 2013 · English (US)
AboutAdvertisingCareersPlatform PoliciesPrivacy Policy