Skip to content

Instantly share code, notes, and snippets.

@DrewDahlman
Last active December 30, 2015 14:59
Show Gist options
  • Save DrewDahlman/7845905 to your computer and use it in GitHub Desktop.
Save DrewDahlman/7845905 to your computer and use it in GitHub Desktop.
Facebook Sharing requires - <script src='http://connect.facebook.net/en_US/all.js'></script>
var shareObj = {
method: 'feed',
link: 'http://LINKEXAMPLE.com',
picture: 'IMAGE URL',
name: 'NAME',
caption: 'EXAMPLE.com',
description: "DESCRIPTION",
};
// FB setup ---------------------------------------------
// $(document.body).append('<div id="fb-root"></div>');
FB.init({
appId: "XXXXXXXX",
status: true,
cookie: true
});
function postToFeed() {
function callback(response) {}
FB.ui(shareObj, callback);
}
$('#facebook').on('click', function(e) {
e.preventDefault();
postToFeed();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment