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

Ajax Library: Backface

Problem

I’d really like to do some nifty Ajax animation effects or use some cool interface widgets and drag-and-drop actions, but none of the traditional Ajax libraries work inside of Platform.

Solution

Backface is a library for creating draggable widgets within your Facebook Canvas. Created by Peter Svensson from Stockholm, Backface (a.k.a. The Library Formerly Known as Prince—or TLFKAP—after he discovered that applications including the word “face” are not allowed on Facebook) can be found at http://apps.facebook.com/backface/ and includes links to the downloadable PHP sample app and source. Backface won’t quench all of your Ajax cravings, but it will allow you to do some neat drag-and-drop stuff, and it has panes and resizable objects coming, all written in FBJS so they don’t run afoul of the parser.

Once you’ve downloaded and unpacked backface.zip, you’ll find some documentation, a demo, and backface.inc, the actual include file. If you’re building your Facebook app in PHP, the easiest way to work with it is to include(backface.inc) in the page you want to use it on.

Discussion

Peter is pretty dedicated to the project and has been quick to respond to developers’ requests for features. You can follow along on his blog at http://unclescript.blogspot.com/, or by keeping tabs on the latest news in the Backface app on Facebook. The original library was hacked together in one late November night and has grown by leaps and bounds as people have asked for new things, ...

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