1.js方法: function replaceErrorImg(obj) { obj.src="images/common/error.bmp"; } 2.jquery绑定 $(‘img‘).error(function() { $(this).attr("src", "images/common/error1.gif"); });
JS使用默认图片代替页面上无法显示的图片
原文:http://www.cnblogs.com/rnckty/p/4094231.html