方法一:
<img src="原图片地址" alt="这是一张加载失败的图片" onerror="this.src='默认图片地址';this.onerror=null;"/>
方法二:
$('img').on('error', function(){ $(this).unbind('error'); //防止替换图片加载失败后陷入无限循环 $(this).attr('src', '替换图片地址'); })