首页 > jquery里error事件

jquery里error事件

 <img src='1.jpg'/>
$('img').click(function(){
    $(this).attr('src','sssss.jpg');
})
$('img').error(function(){
    alert(1);
})

当点击事件把图片的src指向不存在的url时,不触发error事件,


浏览器的问题?

chrome可以触发

http://jsfiddle.net/2LLyp4Lr/

【热门文章】
【热门文章】