Skip to content

Instantly share code, notes, and snippets.

@epierpont
Last active August 29, 2015 14:16
Show Gist options
  • Save epierpont/32218ef368476641b893 to your computer and use it in GitHub Desktop.
Save epierpont/32218ef368476641b893 to your computer and use it in GitHub Desktop.
JS - jQuery hide broken image based on filename
// hide broken images
$( '.post img' ).each(function () {
var img = $(this);
var src = img.attr( 'src' ).split( '/' );
var file = src[src.length - 1];
if( file == "x.gif" ) {
img.hide();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment