I have this code to fetch profile pictures and messages:
$(document).ready(function() {
var url = "https://graph.facebook.com/search?q=cinema&type=post";
$.ajax({
type: "POST",
url: url,
dataType: "jsonp",
success: function(msg){
console.log( msg );
$.each( msg.data , function(i,obj){
var picUrl = 'http://graph.facebook.com/' + obj.from.id + '/picture';
console.log(picUrl);
$.ajax({
type: "POST",
dataType: "jsonp",
url: picUrl,
success: function(pic){
$('#cinemas').append('<img src="' + pic + '"></img>' + obj.message + '<br />');
}
});
});
}
});
});
But i am getting a “Unexpected token illegal” error in the Chrome console.
As far as i know, picUrl produces a valid URL.
I’m not sure what the inner
$.ajaxis for…Here’s a demo of what I think you’re trying to do: http://jsfiddle.net/Lobstrosity/vbDuu/
Let me know if I’m misunderstanding you.