I am trying to get the facebook username using graph api. Here is what I got so far, but its not giving me any data back. please help .
$(document).ready( function() {
var arr = 1101892195;
var url = 'http://graph.facebook.com/' + arr;
$.getJSON(url, function(data) {
var items = [];
$.each(data, function(key, val) {
items.push('li id="' + key + '"' + val + '/li');
});
$('ul', {
'class': 'my-new-list',
html: items.join('')
}).appendTo('body');
});
});
This is restriction of same origin policy
you can’t do this with jquery
Proxy script:
Modified jS: