Occasionally we have times when we have broken image links on our website and replacing them one by one isn’t easy, so adding this simple piece of code can save you a lot of headaches.
$('img').error(function(){ $(this).attr('src', 'img/broken.png'); });