Chapter 2. HTML Design in a Facebook Environment

HTML on an FBML-parsed page renders in just the same way that the FBML renders. On the whole, most HTML tags in the Facebook environment will render the same as normal HTML. However, for the developer’s benefit, as well as for the security and protection of your app, and to integrate better with the Facebook environment, Facebook parses a few tags differently than your normal HTML. This chapter covers a few things to be aware of when designing your Facebook application in FBML.

Forms in FBML

Forms in FBML are almost the same as forms in HTML, but when rendered by Facebook, they produce a few more hidden input fields. The following section covers the specs for the form tag.

The <form/> tag

The form tag renders a form in HTML, adding five additional hidden input fields—the fb_sig_profile, fb_sig_user, fb_sig_session_key, fb_sig_time, and fb_sig parameters—that give more information about the user submitting the form to the processing script. The fb_sig parameter is essentially just a hash (see http://en.wikipedia.org/wiki/Hash_algorithm) of all the other fb_sig_ values preceding it.

It is important to note that the fb_sig_user and fb_sig_session_key parameters are added only if the user using your app has successfully authenticated and logged into Facebook.

FBML-Specific Attributes

requirelogin=[true|false] default: true

If true, the user will be prompted to log in (if they have not already done so), and then they will be asked if they want ...

Get FBML Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.