Created
April 16, 2013 20:16
-
-
Save rsadwick/5399240 to your computer and use it in GitHub Desktop.
Open Facebook book feed dialog to post on timeline
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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