peki hocam error komutunuda çalıştıramadım yanlışlık nerdedir
yapmak istedigim yüklenmeyen bir resim varsa benim belirledigim bir resim gelsin
$(document).ready(function(){
$("img").on("error",function() {
$(this).attr( "src", "resim.jpg" );
})
.attr( "src", $("img").attr("src"));
Ç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"));