Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q639 Can I create an 'on error resume next'?

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.

©2018 Martin Webb