Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

get safari to not show broken image symbol

is there a way to get safari not to show the "broken image" symbol, when an image was not found? firefox does this by default.

i'd preferrably do this with css, but i think javascript will be the way to go... i am using jquery already, eg something like this would be great:

$(document).ready(function(){
    $('img').broken().hide();
});
like image 380
Patrick Oscity Avatar asked Feb 27 '23 09:02

Patrick Oscity


1 Answers

From the jQuery documentation:

$("img").error(function(){
  $(this).hide();
});
like image 159
Lekensteyn Avatar answered Mar 07 '23 13:03

Lekensteyn