Facebook App Development gotchas

Friday 02/19/2010  –  Category: Uncategorized

While developing a Facebook app earlier this week, I ran into a number of gotchas that make developing for Facebook just a bit more painful:

  • If you're developing within an FBML canvas page, you have to adjust your javascript to conform to FBJS. FBJS does a number of things--itwill prepend all your variables and function names with your appid, setting/getting object properties are done through custom methods, you can't create new elements in the DOM, etc. If you need to use heavy javascript, it would be easier to use an iframe-based application.
  • If you're developing a tab-based application, it will start in "passive mode" , which means your Flash and javascript won't run until the user interacts with your page. This means you can't use onload javascript methods until a user clicks something. This was very frustrating because some javascript I adapted to FBJS (to create pretty checkboxes) didn't end up working at all.
  • Also on a tab-based application, your image assets will be cached by Facebook's image proxy cache. For some reason, the proxy cache was really flaky earlier in the week; it would randomly show some assets but fail to load others and would vary on computer to computer and browser to browser.

Leave a Reply