Skip to content

Instantly share code, notes, and snippets.

@ThisIsMissEm
Forked from tatey/gist:296522
Created February 6, 2010 04:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ThisIsMissEm/296524 to your computer and use it in GitHub Desktop.
Save ThisIsMissEm/296524 to your computer and use it in GitHub Desktop.
// Set API key
var my_flickr = $.flickr({
apiKey: '123'
});
// Option 1: Inline callbacks
my_flickr.photos.getRecent({
size: 's'
page: 1,
beforeSend: function() {
$('img#waiting').fadeIn();
},
success: function(thumbnails) {
$('img#waiting').fadeOut();
$('#photos').append(thumbnails);
}
});
// Option 2: External callbacks
my_flickr.photos.getRecent({size: 's', page: 1, beforeSend: before, success: after});
function before() {
$('img#waiting').fadeIn();
}
function after(thumbnails) {
$('img#waiting').fadeOut();
$('#photos').append(thumbnails);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment