1
html img 태그에 이미지가로드되지 않았는지 (404 찾을 수 없음, 기타 4xx 또는 5xx 오류) 알려주고 jquery 콜백으로 신고하는 방법은 무엇입니까?html img 태그에서 이미지로드 실패 여부를 확인하는 방법은 무엇입니까?
html img 태그에 이미지가로드되지 않았는지 (404 찾을 수 없음, 기타 4xx 또는 5xx 오류) 알려주고 jquery 콜백으로 신고하는 방법은 무엇입니까?html img 태그에서 이미지로드 실패 여부를 확인하는 방법은 무엇입니까?
$('img').error(function(){
//...
});
를 문서의 예 :
<img alt="Book" id="book" />
$('#book')
.error(function() {
alert('Handler for .error() called.')
})
.attr("src", "missing.png");
http://stackoverflow.com/questions/1977871/check-if-an-image-is-loaded-no- errors-in-javascript –