HTML5 and Facebook's FBML


This post was orignally posted on Tumblr on the blog: Nerd Ramblings. View the full syndicated blog or view the original post.

The Facebook Markup Langauge (FBML), works well with XHTML but fails when it comes to HTML5. Hopefully they’ll make this work with the final HTML5 standard.

On to the solution

<script src=“”></script>
<script type=“text/javascript”>
document.write(’<fb:like layout=“button_count” show_faces=“true” width=“100”></fb:like>’)

Thats it. Wrap the <fb> tags in Javascript and add ‘document.write’. Comes out as completely valid HTML5.

Add it to your HTML5 site and validate it. 


FBML has been deprecated. Starting June 1, 2012 FBML apps will no longer work as all FBML endpoints will be removed. If you are building a new application on, please implement your application using HTML, JavaScript and CSS. You can use our JavaScript SDK and Social Plugins to embedded many of the same social features available in FBML.


FBML is now covered by a Javascript SDK and Social Plugins. Which are written for HTML5.