Çalışmamasının sebebi nedir? Console'dan kontrol edebildiniz mi? Ben denediğimde sorunsuz çalışıyor.
$("#resim").on('error', function() {
$(this).attr('src', 'https://images.unsplash.com/photo-1562101994-0801ac2007fd?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=60')
}).attr("src", $('#resim').attr("src"));
tamam hocam çözüldü teşekkürler ufak hatalar işte