有什么方法可以知道某些图像在 jquery/javascript 的网页中加载失败。
最佳答案
使用: .error()
$('img').error(function() {
alert('Failed to load the image with src: ' + $(this).attr('src'));
});
关于javascript - 如何知道图像是否无法在 javascript 中加载?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12616600/