REPLACE BROKEN IMAGES WITH A DEFAULT IMAGE
snippet in javascript

REPLACE BROKEN IMAGES WITH A DEFAULT IMAGE

user5843

$('img').on('error', function (){
	$(this).attr('src', '/path/to/image/default.png');
});

/*// OR hide
---------------------------*/
$('img').on('error', function(){
	$(this).hide();
});