なぜかうまくできない。がメモは残しておく
$(function() {
$('img').error(function() {
$(this).attr('src', '/img/notfound.gif');
});
});
Chrome 対応版?
$(function() {
$('img').error(function(){
setTimeout(function() {
$(this).attr('src', 'error.png');
}, 0);
});
});
$(document).ready(function() {
$('img').error(function() {
//ファイルが存在しない画像はimgタグ自体を削除
$(this).remove();
});
});