The window.onerror Event
Aside from syntax and related errors the onerror event is also useful for dealing with errors encountered when a browser tries to load an image. I have not covered this usage in this article because I have yet to encounter a real world scenario where this is useful. Even so, each example presented here can be easily be adapted to work for an image.
To suppress all browser error messages we can create a function that does nothing and assign it to trigger when the error event happens. [View Suppression Example]