Skip to content

Instantly share code, notes, and snippets.

@maeharin
Created April 22, 2012 13:58
Show Gist options
  • Save maeharin/2464232 to your computer and use it in GitHub Desktop.
Save maeharin/2464232 to your computer and use it in GitHub Desktop.
show facebook user's public information (javascript/jQuery)
<html>
<div id="hoge"></div>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script>
var user_id = 'zuck'; //facebook id
var url = 'https://graph.facebook.com/' + user_id + '?callback=?';
var additional_html;
$.getJSON(url, function (res) {
for(var i in res) {
additional_html += i + ':' + res[i] + '<br>';
}
$('#hoge').html(additional_html);
});
</script>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment