Facebook Developers
DocsToolsSupportNewsApps
Log In
  • Getting Started
  • Core Concepts
  • Advanced Topics
  • Technical Guides
  • API Reference
  • SDK Reference
    • JavaScript SDK
    • PHP SDK
    • iOS SDK
    • Android SDK
  • 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.getPageInfo
    • 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

SDK Reference › JavaScript SDK › 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:live-stream
  • 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 4 months ago
Facebook © 2012 · English (US)
AboutAdvertisingCareersPlatform PoliciesPrivacy Policy