Sunday, January 10, 2010

Facebook Javascript Samples

I was hooking together a Facebook application and had created this sample application to try out different Facebook APIs. I think my initial struggles with FB API were because of FB documentation not being very structured and FB having too many (sometimes overlapping and confusing) integration points. The latter is however being sorted out now by cleaning up and merging many of the integration points.

I also had struggled for quite some time with the cross domain scripting elements of FB, rather the location of xd_receiver.htm to be specific. Technically, it should work as long as I place xd_receiver.htm anywhere in my domain. It need not be exactly at the same location as my canvas or connect page. However, FB APIs do not seem to be uniform in their treatment towards the location of xd_rceiver.htm. Particularly the FB Connect APIs require that xd_receiver.htm must be at the same location as the connect URL.

With the thought that it might be useful for others, I've shared it as an FB app called "Javascript API Samples" in the "Utilities" section of listed applications. It is an IFrame Canvas application with all static pages. The static pages are hosted on Google App Engine.


paulmacp said...

Do you have a copy of the code in a human readable format anywhere for your API sample app?


Tanmay said...

@paulmacp All the code is in the javascript. So you just need to do a view source of the app frame on your browser and also pull in the js files listed in it. Hope that helps.