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

FB.XFBML.parse

JavaScript › Reference › FB.XFBML.parse

Overview

This function parses and renders XFBML markup in a document on the fly. This could be used if you send XFBML from your server via ajax and want to render it client side. XFBML enables you to incorporate FBML into your websites and IFrame applications.

You can parse the following XFBML tags with this method:

  • fb:activity
  • fb:comments
  • fb:friendpile
  • fb:like
  • fb:like-box
  • fb:login-button
  • fb:name
  • fb:profile-pic
  • fb:recommendations

Examples

To re-parse all of the XFBML on a page, you can call:

  FB.XFBML.parse();

Alternately, to only evaluate a portion of a document, you can pass in a single element.

  FB.XFBML.parse(document.getElementById('foo'));

Parameters

NameTypeDescription
domDOMElement

root DOM node, defaults to body

cbFunction

invoked when elements are rendered

Updated about 2 weeks ago
Facebook © 2013 · English (US)
AboutAdvertisingCareersPlatform PoliciesPrivacy Policy