JS exception capture: the usage and example analysis of onerror() in window

From: https://www.jb51.net/article/78765.htm
Note: OnError will only be triggered if the error is run. Syntax error will not be triggered.
There are three ways to cause an onerror:
• runtime errors, such as invalid object references or security restrictions
• download errors, such as images
• in IE9, failure to obtain multimedia data is also thrown
Please refer to the link above for details

Read More: