I am trying to upload a facebook feed using jQuery on the client side of my site. The channel I use to request facebook is:
http://www.facebook.com/feeds/page.php?format=json&id=40796308305
I tried the following approbations:
1.
$.getJSON('http://www.facebook.com/feeds/page.php?format=json&id=40796308305',function(data){ console.log(data) });
Which returns an error:
XMLHttpRequest cannot load http://www.facebook.com/feeds/page.php?format=json&id=40796308305 . The origin of http: //xxxx.local is not allowed by Access-Control-Allow-Origin.
2.
$.ajax({ url: 'http://www.facebook.com/feeds/page.php', type: 'GET', dataType: 'json', data: { id: '40796308305', format: 'json' }, success: function(data, textStatus, xhr) { console.log(data); } });
It returns the same error.
3.
$.ajax({ url: 'http://www.facebook.com/feeds/page.php', type: 'GET', dataType: 'json', data: { id: '40796308305', format: 'jsonp' }, success: function(data, textStatus, xhr) { console.log(data); } });
Return:
Uncaught SyntaxError: Unexpected token:
And it seems the feed is parsing.
How to load facebook json feed so that I can access it, how do I make an array?