I need a script that can determine the reason the image is not loading based on the provided HTTP status code.
I am aware of the onError event on images and objects, but it does not pass an error code. So if an image has a broken source or a timeout has occurred, it is treated the same.
I would like to have a script that can determine the error code and act accordingly. For instance:
- 404 - replace the image with a predefined
- 403 - Admin Notification Using Callback Function
- 504 - try rebooting
- and etc.
I did some google searches, but besides the onError event, I came to an end.
Any ideas?