I need a script that can determine the reason an image didn't load based on the HTTP status code supplied.
I am aware of the onError event on images and objects, but it does not pass the error code. So if an image has a broken source or a time out occurred are dealt with the same way.
What I would like is to have a script that can determine the error code and act accordingly. For example:
- 404 - replace image with a predefined one
- 403 - notify admin using an callback function
- 504 - try to reload
- etc.
I've done some searching on google, but other than the onError event I came up short.
Any ideas?