Web Standards

Martin Kuplens-Ewart (see his bio in Contributors)

Problem

I want to create an innovative application that I can build on Facebook and also deploy to other platforms (such as OpenSocial, iPhone, etc.) in the future.

Solution

Build your application with standards-compliant techniques, including clean, semantic HTML (FBML) to mark up your content and page structure, hack-free CSS to style your application, and DOM scripting using JavaScript (FBJS) to interact with your application’s backend code to make the whole thing work.

Discussion

Crucial for the success of a Facebook application is constant innovation and experimentation. The best applications keep refining interactions, implementing new features, and developing new ways for their users to engage with their friends.

As you plan out your application, it may be worth preparing to structure it in two parts: the Facebook interface elements that are viewed by the user, and your application logic, which is hosted and accessed independently of the Facebook environment. This kind of separation between the layers of your application will be crucial if you intend to deploy to other platforms down the road. See Figure 6-1.

Separating interface and logic using Ajax calls

Figure 6-1. Separating interface and logic using Ajax calls

There are three elements to your standards-compliant development toolkit:

  1. FBML (HTML), used for marking up content and establishing boundaries of elements ...

Get Facebook Cookbook 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.