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 may combine the couple technics to get img.status:
function error(img) {
var r = makeXMLHttpRequestAgain(img.src);
if (r.status === 500) img.src = '/e500.img';
if (r.status === 503) img.src = '/e503.img';
}