Skip to content

Instantly share code, notes, and snippets.

@Rafailong
Created January 29, 2014 18:31
Show Gist options
  • Save Rafailong/8694015 to your computer and use it in GitHub Desktop.
Save Rafailong/8694015 to your computer and use it in GitHub Desktop.
Check if an image is loaded
var imgsrc = 'img/image1.png';
$('<img/>').load(function () {
alert('image loaded');
}).error(function () {
alert('error loading image');
}).attr('src', imgsrc);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment