tags:

views:

11520

answers:

10

We're starting a new facebook app (incidentally in Rails), and are faced with the decision to use FBML or to use IFrames. It seems like in the past the consensus generally was that FBML was the better way to go, as it made things more inherently Facebook looking, however it seems now like things on the iFrame side are starting to improve, with one of their main engineers saying we should use iframes

So I'm wondering what have people found to work best. What benefits and drawbacks have you seen with either the iFrame approach, or the FBML approach.

Or, are people using a mix of both. I see there's a way you can override the setting in specific places.

Thanks Stack Overflowers!

+10  A: 

I find FBML easier if you want to make your app look just like Facebook with less effort in duplicating their styling.

Iframes of course give you more control.

So which do you prefer - quicker development or more precise control over the results?

Leigh Caldwell
+4  A: 

Well, I'll have to agree with the poster above me and say that FBML makes it much easier to create a facebook-ish style to your application without having to rip off CSS pages ;}

Its also quite great working with the fb tags instead of creating makeshift solutions at times.

Both ways are good, but FBML tends to contribute to more effective and efficient development for Facebook. So, in the general case, I would probably go ahead and use FBML, unless you have some specific need for IFrame fine tuning.

+43  A: 

I have been developing a facebook app for the past several months, and recently switched our canvas page from FBML to an IFrame. The main reason for doing so has to do with these posts and features:

Lead Facebook Engineer Recommends Developers Use IFrames for Speed, Convenience

XFBML - Facebook Developer Wiki

Basically, you can now embed FBML into an IFrame canvas using the XFBML features that were implemented to support Facebook Connect. IFrames may have performance improvements (although those are probably trashed by the client-side requests required by XFBML, which are a little tedious to set up at first), but the main advantages for me are:

1) The ability to use jQuery or any other stuff I want.

2) Useful, relevant ads from adsense, since I no longer have to embed the adsense javascript in its own IFrame.

Once I made this switch, I realized that I was able to get all the facebook data I needed through the API, and take advantage of memcached to improve performance. So, now my canvas is just plain old HTML, without any XFBML.

Hope this helps.

jmans
you should edit your post and make the URL shorter
hayalci
Facebook recently announced that developers won't be able to create new FBML applications starting next year. This won't affect existing FBML applications, but all future apps must be developed for iframe.
John Himmelman
+1  A: 

Using FBML gives you much deeper integration with Facebook as a whole.

Nick Gerakines
+3  A: 

To sum up: FBML makes better and more integrated applications. IFrame is easier to use and gives you more freedom with development (If your application is already sort of completed and you just want to add a "facebook leg" to it - it's very easy.

Faruz
+2  A: 

IFrames seem to work better if you have a client side using Flash or Silverlight. I couldn't get FBML working with a Silverlight client but when I switched to IFrames it worked fine.

Nick Gotch
+2  A: 

I've developed about 30 Facebook apps over the past few years, almost all FBML based. I've also done some Facebook Connect implementations, which is really what you are doing with an iframe app.

By creating an iframe based app, it's not too much extra work to implement Facebook Connect for the main website, if there is one. Your content also isn't sanitized, so you can used standard html, css, and javascript without worries.

On the flip side, you can still only use FMBL/FBJS for the tab content for any application. FBML apps also have the added advantage of being able to do server side processing on initial page load. With an iframe, you need to gather the information client side, then pass it to the server. For example, Preload FQL is a bit more complicated with iframe apps than with FBML apps.

Brent Baisley
A: 

with use of FBML you can open some new ways of interacting with your visitors. You may use landing pages, fbml templates, widgets, or some cute photos to attract your visitors.

michael_vreek
+5  A: 

The answer is iFrame for sure. Facebook has phased out the usage of FBML by the end of this year 2010

Tedd
Completely agree. Facebook is deprecating FBML. See this roadmap for full details: http://developers.facebook.com/blog/post/402
JohnnyO
+3  A: 

Seriously, you need to refer to this link before you decide to go with FMBL any further. Facebook will stop allowing new FBML applications by end of 2010. All Tabs Page and Canvas Application will be transition to iFrame apps, no more FMBL, and say GoodBye to FBML! http://developers.facebook.com/roadmap

Tedd