Contact: (801) 853-8339 or jesse@staynalive.com
Twitter, FriendFeed, LinkedIn, or Facebook
Like StayNAlive.com on Facebook!:
TwitterCounter for @Jesse

Facebook to Soon Allow Javascript?

First of all, it was excellent to meet and talk to everyone at the Utah Blogger Dinner on Thursday! I got to finally meet a few people, chatted a lot with many about Facebook, and was able to give a brief tutorial on Phil801′s laptop of the basics of setting up a Facebook app. I feel like I am becoming one of the local experts on the subject lately – maybe I should go into consulting! Phil801 also showed me some really cool stuff he is doing on The Daily Spike that he is working on. That is one incredible engine he has set up, and I really look forward to his official launch because it looks to be a very needed tool in the blogging world.

There’s some buzz in the Facebook Developer Forums (login required) lately about a new tag that seems to have crept up called fb:fbjs-string. It seems to require a variable called “var” passed to it, and appears to be some sort of sandbox currently for Facebook to possibly allow javascript within their developer API. This would definitely be a welcome addition, as the API currently, while still flexible, is rather limiting without much javascript support (with the exception of a few show/hide controls and limited ajax support). Here is the basic tag – when you type this in:

<fb:fbjs-string var=”test”>test</fb:fbjs-string>

It translates to the following in the actual web page:

<script type=”text/javascript”>

var a2353941073_test=new fbjs_fbml_string(‘test’)
</script>

I looked up fbjs_fbml_string(), and it just does this:

function fbjs_fbml_string(html){fbjs_private.get(this).htmlstring=html;}

I will have to sift through all of their javascript libraries to figure out what htmlstring does – anyone aware if this is easier done in Firebug? I am assuming that it is basically setting up a javascript object variable for you to access later, which through some other routine they will (or just haven’t made public yet) provide will allow you to do stuff with the text or javascript you passed to it. I need to investigate this further. If you find something I haven’t seen feel free to post it!

  • Great idea Ruben! I will try that out. I think there's also a way to do that in firebug - I just haven't played with it long enough to find out.

  • Hey,


    You could install DebugBar on IE and if you have a javascript debugger installed (the Script debugger comes with MS Office). You can type in the javascript part of the DebugBar something like this:


    debugger;
    new fbjs_fbml_string(’test’);


    And then you can step through the code to see exactly what it's doing.


    Hope this Helps.


    http://www.debugbar.com/

blog comments powered by Disqus