agorapulse / grails-facebook-sdk

Facebook SDK Grails Plugin
http://agorapulse.github.com/grails-facebook-sdk/guide
30 stars 13 forks source link

Feature request: Hook into the fbAsyncInit event? #3

Closed aldrinm closed 12 years ago

aldrinm commented 12 years ago

Is there a way to hook into the fbAsyncInit event handler created by the plugin? Or a way to invoke any function after Facebook is initialized?

benorama commented 12 years ago

Yes, you can put JS inside initJS tag. It will be automatically injected inside the fbAsyncInit function body.

<facebook:initJS appId="${facebook.app.id}">
  // Put here any JS code to be executed after Facebook JS initialization
  alert('Some JS code');
</facebook:initJS>
aldrinm commented 12 years ago

awesome. works perfectly. i must've missed it in the docs.

benorama commented 12 years ago

It is not yet in the documentation ;). I've added it, it should be in next release.