Hi there.
I am trying to load images from the Facebook graph api into a div on my website.
I have a div for each of the albums on my facebook page, each has the url id in the rel value. I am trying to loop through the graph api urls and load the first image in each json datablock using the code below:
$('.thumbnail').each(function(index) {
$.getJSON('http://graph.facebook.com/'+ $(this).attr('rel') +'/photos', function(data) {
$(this).css('background-image', 'url('+ data.data[0].picture +')');
});
});
You can see an example of the json here: http://graph.facebook.com/422882642272/photos
I am just trying to traverse the json and load the 'picture' value from the first node.