Missing Image handling
29-12-2015 16:49:42
JQuery / Common
0 Bookmark(s)
171 View(s)
Browsers show an ugly broken image icon, if an image was not found on the server.
This can be improved by showing either a nicer icon:
$('img').error(function(){
$(this).attr('src', 'notfound.png');
});
or, hide missing images on the page
$("img").error(function(){
$(this).hide();
});