Skip to content

Instantly share code, notes, and snippets.

@jamesmk
Created May 4, 2012 23:30
Show Gist options
  • Save jamesmk/2598370 to your computer and use it in GitHub Desktop.
Save jamesmk/2598370 to your computer and use it in GitHub Desktop.
Image load detction
$("<img/>")
.load(function() {
// image loaded
})
.error(function() {
// oh noes!
})
.attr("src", '/path/to/image.jpg');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment