Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

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

irt.org | Knowledge Base | JavaScript | Misc | Q639 [ previous next ]

Q639 Can I create an 'on error resume 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.


Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb and Michel Plungjan
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.