javascript - get safari to not show broken image symbol - Stack Overflow

is there a way to get safari not to show the "broken image" symbol, when an image was not fou

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();
});

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();
});
Share Improve this question asked Aug 28, 2010 at 11:16 Patrick OscityPatrick Oscity 54.7k18 gold badges146 silver badges169 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 6

From the jQuery documentation:

$("img").error(function(){
  $(this).hide();
});

There is and event handler called onerror which you can add to the images:

<img src="image.png" onerror="this.style.visibility = 'hidden'" />

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745534677a4631851.html

相关推荐

  • javascript - get safari to not show broken image symbol - Stack Overflow

    is there a way to get safari not to show the "broken image" symbol, when an image was not fou

    9小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信