FBML (FaceBook Markup Language) is a markup language proposed by Facebook to extend some of the core functionalities of the social network itself. In its simplest form, it's made up of code snippets that, once inserted into the markup of a web document, allow us to use some Facebook's gadgets and widgets.
For example, the following code adds a "Like" button to our pages:
Unfortunately, this code won't pass the W3C validation. Theoretically speaking, this problem would arise only with HTML, which is not extensible and its DTD is immutable. On the contrary, if we serve our documents as XHTML 1.1 and with a custom DTD, then we could use FBML without any problem.
I say "theoretically", because with XHTML 1.1 we must:
- serve our documents as
- specify the FBML namespace in the root element (
- create a custom DTD
var $fbLike = '<fb:like href="http://www.site.com/"></fb:like>'; $($fbLike).appendTo('body');
<noscript> <p><a href="http://www.facebook.com/plugins/like.php?href=http%253A%252F%252Fwww.site.com">Like</a></p> </noscript>
By providing a simple textual link within a
noscript tag we cater the accessibility needs of our users.