onerror syntax uses
onerror has three input parameters by default:
•msg: error message
•url: The file where the error is located
•line: The line of code where the error is located, integer
window.onerror = function(msg, url, line){ // some code };
For the form of
What we most commonly use in js is js fault tolerance
window.onerror=function(){return true;}
Basic Features
You can prevent the browser from displaying error messages by setting returnValue=true or returning true directly. But it will not prevent the debugging box from popping up by script debuggers.
Onerror will only be triggered by runtime errors, not by syntax errors.
Onerror can be triggered in the following three ways:
• Runtime errors such as invalid object reference or security restriction
• Download errors such as pictures
•In IE9, failure to obtain multimedia data will also trigger
The