Take the 2-minute tour ×

I'm just wondering if it is possible to use the Facebook Javascript SDK and OAuth 2.0 in an Javascript bookmarklet, because I just can't get it to work. What I'm actually trying to do is to update my Facebook status through my bookmarklet, but it seems like FB.init does nothing. Also I don't get any failure responses.

Is it possible to do something like this or am I violating any sandboxes or so?

I'm using an jquery bookmarklet boilerplate which works great. When initializing the bookmarklet I append the sdk

    var d = document,
        js = d.createElement('script'),
        root_node = d.createElement('div');

    js.id = 'facebook-jssdk';
    js.async = true;
    js.src = "http://connect.facebook.net/en_US/all.js";
    root_node.id = 'fb-root';

and then call fb.init

    window.fbAsyncInit = function(){

        console.log('JS-SDK loaded');

            appId: 'XXX', 
            status: true, 
            cookie: true,
            xfbml: true,
            oauth: true



Actually it looks like "console.log(response)" never gets called

Thanks, martin

share|improve this question
can't get it work, what did you do so far ? –  Dhiraj Bodicherla May 10 '12 at 15:01
i updated my original post. dunno why, but it works now .. after a whole day of try & error. Now I have the problem that the fb.init method only works when i'm on the Canvas URL, which is defined in my facebook app settings. when i trigger the bookmarklet on another page nothing happens. Is there a way to get my bookmarklet work on any website? –  martin May 11 '12 at 10:11

1 Answer 1

You should probably have your bookmarklet open a new page on your Canvas URL and then have it post from that page.

share|improve this answer

Your Answer


