You are here: irt.org | FAQ | JavaScript | Misc | Q639 [ previous next ]
The window objects onerror event handler was introduced in JavaScript 1.1.
Syntax:
onerror = functionname;
For example:
<SCRIPT LANGUAGE="JavaScript1.1"><!-- onerror = report; function report(message,url,line) { alert('Error : ' + message + ' at line ' + line + ' in ' + url); } // cause an error: x(); //--></SCRIPT>
If the function returns true then nothing further happens, if the function returns false then the normal JavaScript error reporting occurs. It is not possible to resume. This may change with Internet Explorer 5.