No results are returned when using Flickr JSON request
- by Martijn1981
I'm still fairly new to AJAX and I'm experimenting with Twitter and Flickr. Twitter is working fine so far, but I've run into some issues with the Flickr API.
I'm getting no results back. The URL seems to be working fine and I'm pointing to the right object containing the array ('items'). Can anybody tell me what I'm doing wrong please? Thanks!
$('#show_pictures').click(function(e){
e.preventDefault();
$.ajax({
url: 'http://api.flickr.com/services/feeds/photos_public.gne?format=json&jsoncallback=?&tags=home',
dataType: 'jsonp',
success: function(data) {
$.each(data.items, function(i, item){
$('<div></div>')
.hide()
.append('<h1>'+item.title+'</h1>')
.append('<img src="'+item.media.m+'" >')
.append('<p>'+item.description+'</p>')
.appendTo('#results')
.fadeIn();
})
},
error: function(data) {
alert('Something went wrong!');
}
});
});