Skip to content

Instantly share code, notes, and snippets.

@tatey
Created February 6, 2010 04:02
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 tatey/296522 to your computer and use it in GitHub Desktop.
Save tatey/296522 to your computer and use it in GitHub Desktop.
// Set API key
$.flickr.settings.apiKey = '123'
// Option 1: Inline callbacks
$.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
$.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