(Quick Reference)
facebook:initJS
To initialize
Facebook JS SDK in your GSP views, simply insert
initJS tag, after HTML body tag.
The only required attribute is
appId.
<facebook:initJS appId="${facebookContext.app.id}" />You can put any JS code inside initJS tag. It will be automatically injected inside the fbAsyncInit function body.
<facebook:initJS appId="${facebookContext.app.id}">
// Put here any JS code to be executed after Facebook JS initialization
alert('Some JS code');
</facebook:initJS>Attributes
Required attribute is :
appId Facebook app id
version API version (API v1.0 for app created before April 30th, 2014, API v2.0 for the others.
Optional attributes are :
autoGrow Call FB.setAutoGrow() after page rendering (default to false).
channel Define if channel is enabled (default to true).
channelUrl Channel url (default to provided channel).
cookie Enable cookies to allow the server to access the session (default to true).
locale Define JS SDK locale (default to server locale).
status Check login status (default to false).
xfbml Parse XFBML (default to false).