How to fix broken images in Javascript

To fix broken images in Javascript you can use the following snippet.

Sample Javascript

$('image').error(function(){
$(this).attr('src', ‘image/no_image.png’);
});

Please Share us:
Please rate this snippet

2 thoughts on “How to fix broken images in Javascript

Leave a Reply