I'm trying to load a facebook wall feed with jQuery on the client side of my website. The feed I'm using for the facebook request is:
http://www.facebook.com/feeds/page.php?format=json&id=40796308305
I've tried the following aproaches:
1.
$.getJSON('http://www.facebook.com/feeds/page.php?format=json&id=40796308305',function(data){
console.log(data)
});
Which returns the error:
XMLHttpRequest cannot load http://www.facebook.com/feeds/page.php?format=json&id=40796308305. Origin 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);
}
});
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);
}
});
Returns:
Uncaught SyntaxError: Unexpected token :
And seems to be parsing the feed.
How do I load the facebook json feed so that I can access it as i do an array?