I have a table with some images that I want to start out with no images in them.I have set the src=\"\".But when viewed in a browser it shows broken image pics.
If you just want to get rid of broken image icon & don't want to hide the image and want to keep the resolution of it as is; Use a transparent base-64 image, to replace it.
Jquery:
$("img").on("error", function() {
$(this).attr('src' ,'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=');
});
Pros: