Skip to content

Instantly share code, notes, and snippets.

@sferik
Created August 11, 2009 20:14
Show Gist options
  • Save sferik/166085 to your computer and use it in GitHub Desktop.
Save sferik/166085 to your computer and use it in GitHub Desktop.
JQuery code to swap out broken images with a replacement image.
$(document).ready(function() {
$('img').error(function(){
$(this).attr('src', 'not_found.png');
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment