Skip to content

Instantly share code, notes, and snippets.

@John2496
Created August 12, 2013 19:25
Show Gist options
  • Save John2496/6214225 to your computer and use it in GitHub Desktop.
Save John2496/6214225 to your computer and use it in GitHub Desktop.
<a onclick="shareToFacebook()">Share to facebook</a>
<script>
shareToFacebook = function() {
FB.ui({
method: 'feed',
name: 'Facebook Dialogs',
link: 'https://developers.facebook.com/docs/reference/dialogs/',
picture: 'http://fbrell.com/f8.jpg',
caption: 'Reference Documentation',
description: 'Dialogs provide a simple, consistent interface for applications to interface with users.'
},
function(response) {
if (response && response.post_id) {
alert('Post was published.');
} else {
alert('Post was not published.');
}
});
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment