Of course a lot of applications don't use FBML at all, and use the IFrame approach instead. I am currently working on just such an application. My reason was not using FBML was simple: I needed JavaScript. I didn't even need complicated JavaScript. I just needed to let users click on an image, then set some hidden fields and submit a form. Pretty simple really, but not possible with FBML. Until today.
I go on Facebook this morning and what do I see? An announcement about Facebook JavaScript. I had actually seen this mentioned as being in beta a couple of weeks ago, and I guess it went from beta to production very rapidly.
Looking at its documentation, the were two puzzling things. First, you have to put your JS, err I mean FBJS, inside XML comments... That's a minor thing, and I can easily imagine how it simplifies their parsing of the response from your server. Next, they've wrapped almost all the DOM properties and methods. This makes sense, after all they don't want people to actually get the real DOM object and start screwing around with Facebook's real estate. But their wrapper uses getter/setters for all the properties ... That just seems arbitrary. If Facebook was written using Rails I would expect something like that, but I don't expect something like this from PHP guys.
There were also some very expected things. Like no JS runs on the profile unless it is triggered by what Facebook is calling an "active" event (like clicking on an image or link.) You can't subclass Array or Function. Does this prevent you from accessing their prototype and overriding default behavior?
Anyways, I am happy to see FBJS. I wish it would have been out sooner, as I think it could have simplified some work I've done in the past.
johnsonvlissides
1 comment:
Not being a programmer/developer how hard is it to turn a line of javascript (calling my Aweber form) into FBJS? I'm embedding raw html to get around FB's non-support for Javascript but that entails recopying the html whenever I make a change to the form.
Post a Comment