Skip to content

Instantly share code, notes, and snippets.

Created June 17, 2011 16:34
Show Gist options
  • Save anonymous/1031759 to your computer and use it in GitHub Desktop.
Save anonymous/1031759 to your computer and use it in GitHub Desktop.
jQuery src loading plugin
(function($) {
$.fn.src = function(uri, callback) {
return this.each(function() {
var $this = $(this);
$this.attr('src', 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==');
$this.one('load', callback);
$this.attr('src', uri);
})
}
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment