O'Reilly logo

Facebook Cookbook by Jay Goldman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

FBML Versions

Problem

I know there are different versions of FBML and some tags require FBML 1.1, but how do I set or even know which version I’m using?

Solution

Wrap your FBML in fb:fbml tags and specify a version you want them executed with:

<fb:fbml version="1.1">
    <!-- FBML Here -->
</fb:fbml>

Discussion

You can include an fb:fbmlversion tag inside an fb:fbml tag to output which version is being used to parse that content, though you should note that this is really only intended for debugging purposes. As an example, the following:

<fb:fbml version="1.0">
    <p>This is <fb:fbmlversion /></p>
</fb:fbml>
<fb:fbml version="1.1">
    <p>This is <fb:fbmlversion /></p>
</fb:fbml>
<fb:fbml version="1.2">
    <p>This is <fb:fbmlversion /></p>
</fb:fbml>

will give you:

This is 1.0
This is 1.1

You might have expected to get a third paragraph for 1.2, but the FBML parser ignores it because that version didn’t exist at the time this book was written. Using an fb:fbmlversion tag outside of an explicit fb:fbml tag should give you 1.0, since that’s the assumed default if you haven’t specified otherwise.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required