Skip to content

Instantly share code, notes, and snippets.

@skyzer
Created November 15, 2014 04:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skyzer/e8cab973eca881a4e915 to your computer and use it in GitHub Desktop.
Save skyzer/e8cab973eca881a4e915 to your computer and use it in GitHub Desktop.
function postToFeed(title, desc, url, image) {
var obj = {method: 'feed', link: url, picture: image, name: title, description: desc};
function callback(response){}
FB.ui(obj, callback);
}
$('.btn-facebook').click(function(e) {
var elem = $(this);
postToFeed(elem.data('title'), elem.data('desc'), elem.prop('href'), elem.data('image'));
return false;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment