Skip to content

Instantly share code, notes, and snippets.

@deanc
Created March 25, 2014 14:40
Show Gist options
  • Save deanc/9763197 to your computer and use it in GitHub Desktop.
Save deanc/9763197 to your computer and use it in GitHub Desktop.
$.getScript('//connect.facebook.net/en_UK/all.js', function(){
FB.init({
appId: 'APPID',
channelUrl: '//siteurl.com/channel.html',
});
$("#some-btn-id").click(function () {
FB.ui(
{
method: 'feed',
name: 'Title of the share',
link: 'http://example.com/',
picture: 'http://example.com/logo.png',
//caption: 'Reference Documentation',
description: 'Description body text for the share'
},
function(response) {
if (response && response.post_id) {
} else {
// post was not published...
}
}
);
return false;
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment