I have a page with a lot of images that are generated server-side depending on user actions. And when image loads successfully I\'m happy, but when there is an error on the
You cannot check HTTP status this way. However you can check if image was loaded or not using naturalWidth property.
if (img.naturalWidth === 0) { // do sth }
Hope it help.