Skip to content

Instantly share code, notes, and snippets.

@timotta
Created September 30, 2011 17:18
Show Gist options
  • Save timotta/1254395 to your computer and use it in GitHub Desktop.
Save timotta/1254395 to your computer and use it in GitHub Desktop.
FBXPTO = {
iniciado: false,
init:function(callback) {
var self = this;
$('body').append('<div id="fb-root"></div>');
window.fbAsyncInit = function() {
FB.init({appId: 'MYID', status: true, cookie: true, xfbml: true});
callback();
self.iniciado = true;
};
var e = document.createElement('script'); e.async = true;
e.src = 'http://connect.facebook.net/en_US/all.js';
document.getElementById('fb-root').appendChild(e);
},
perguntar:function() {
var self = this;
if( !this.iniciado ) {
this.init(function(){
self.perguntar();
});
return;
}
FB.ui({method: 'apprequests',
message: 'mymessage',
}, function() {} );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment