An HTML <img>
element has a boolean complete
property, which is true
if the image has successfully loaded (or if it hasn't yet been assigned a src
). It also has an onload
event, which fires when the image successfully loads, and an onerror
event, which fires when the image fails to load (e.g. due to a broken link, corrupt image, or offline network).
Now... what I want to know is if there is a property on an image element that denotes that the image has already failed to load. Assume that I cannot use the onerror
event, because the script may only have access to the image after the event has fired. What we are looking for is a simple boolean lookup property like complete
that says "the loading of this image was already attempted, and it failed". (Which I don't see in the spec, but I'm wondering if I'm missing something).