Skip to content

Instantly share code, notes, and snippets.

@raulanatol
Created April 15, 2016 06:33
Show Gist options
  • Save raulanatol/aadbb9929f71e55231ea6a6777209de1 to your computer and use it in GitHub Desktop.
Save raulanatol/aadbb9929f71e55231ea6a6777209de1 to your computer and use it in GitHub Desktop.
Automatically put a default image in broken images
$('img').error(function(){
$(this).attr('src', 'assets/images/broken.png');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment