공부
[jQuery] check loaded image
승가비
2020. 7. 28. 22:19
728x90
$("<img/>")
.on('load', function() { console.log("image loaded correctly"); })
.on('error', function() { console.log("error loading image"); })
.attr("src", $(originalImage).attr("src"))
;
https://stackoverflow.com/questions/1977871/check-if-an-image-is-loaded-no-errors-with-jquery
Check if an image is loaded (no errors) with jQuery
I'm using JavaScript with the jQuery library to manipulate image thumbnails contained in a unordered list. When the image is loaded it does one thing, when an error occurs it does something else. I'm
stackoverflow.com
728x90