如何知道是否在javascript中加载图像失败?
有没有办法知道jquery/javascript中的某些图像无法加载到网页中。使用:如何知道是否在javascript中加载图像失败?,javascript,jquery,asp.net,html,web,Javascript,Jquery,Asp.net,Html,Web,有没有办法知道jquery/javascript中的某些图像无法加载到网页中。使用: $('img').error(function() { alert('Failed to load the image with src: ' + $(this).attr('src')); }); 用法: $('img').error(function() { alert('Failed to load the image with src: ' + $(this).attr('src')); })
$('img').error(function() {
alert('Failed to load the image with src: ' + $(this).attr('src'));
});
用法:
$('img').error(function() {
alert('Failed to load the image with src: ' + $(this).attr('src'));
});