Skip to content

Instantly share code, notes, and snippets.

@jkudish
Created November 10, 2010 07:14
Show Gist options
  • Save jkudish/670484 to your computer and use it in GitHub Desktop.
Save jkudish/670484 to your computer and use it in GitHub Desktop.
better image error handling w/ jquery
// Replace source
$('img').error(function(){ $(this).attr('src', 'missing.png');
}); // Or, hide them
$("img").error(function(){ $(this).hide();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment