Skip to content

Instantly share code, notes, and snippets.

@rsadwick
Created April 16, 2013 20:16
Show Gist options
  • Save rsadwick/5399240 to your computer and use it in GitHub Desktop.
Save rsadwick/5399240 to your computer and use it in GitHub Desktop.
Open Facebook book feed dialog to post on timeline
FB.init({appId: "APP_ID_HERE", status: true, cookie: true});
$(document).ready(function() {
$('#some_btn').on('click', function(e){
e.preventDefault();
var obj = {
method: 'feed',
redirect_uri: 'YOUR URL HERE',
link: 'link_here',
picture: 'src_here',
name: 'bold title here',
caption: 'caption',
description: 'desc'
};
FB.ui(obj, callback);
});
function callback(response) {
document.getElementById('msg').innerHTML = "Post ID: " + response['post_id'];
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment