If an image (uploaded anonymously) has already been removed, trying to set its URL in the SRC attribute of an image through javascript calls the load event handler and a generic removed.png image is visible. I expected the error handler to be called instead.
So, how can I know in my load handler that something went wrong to act accordingly?
Thanks
Good Image:
HTTP/1.1 200 OK
Server: cloudflare-nginx
Date: Fri, 26 Jul 2013 02:06:40 GMT
Content-Type: image/jpeg
Transfer-Encoding: chunked
Connection: keep-alive
Set-Cookie: __cfduid=d0db003f7d7099660cb833a11bcc55c361374804400030; expires=Mon, 23-Dec-2019 23:50:00 GMT; path=/; domain=.imgur.com
Access-Control-Allow-Methods: GET, OPTIONS
Access-Control-Allow-Origin: *
Cache-Control: public, max-age=315360000
Expires: Mon, 24 Jul 2023 02:06:40 GMT
CF-Cache-Status: HIT
CF-RAY: 93d882c3f0e04ef
var httpRequest = new XMLHttpRequest();
httpRequest.open('GET', 'http://imgur.com/gallery/2HhJVlT',false);
httpRequest.send(null);
alert(httpRequest.getAllResponseHeaders());
on a side note the last header's value is awesome:
Content-Type: text/html; charset=utf-8
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Pragma: no-cache
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Content-Encoding: gzip
Content-Length: 8560
Accept-Ranges: bytes
Date: Fri, 26 Jul 2013 03:07:54 GMT
Connection: keep-alive
X-Imgur-Cached: 0
Server: cat factory 1.0