$(function () {
$(\'img\').each(function () {
$(this).bind(\'load\', function () {
$.Deferred().resolve();
}).bind(\'error\', function () {
//图片加载错误,加入错误处理
// dfd.resolve();
alert(\'error\');
})
})
})
HTML代码
<body>
<img src="/images/01.png" />
</body>