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

Q503 How do you handle runtime errors in JavaScript?

You are here: irt.org | FAQ | JavaScript | General | Q503 [ previous next ]

The first thing to do is code your JavaScript so that the error does not occur - I've yet to see a problem that cannot be tackled by checking first to see if something will work, before allowing it to fail.

You can then try using the onerror event handler available in Netscape Navigator 3+:

<script language="JavaScript"><!--
function myClose() {
    self.close();
}

self.onerror = myClose;
//--></script>

Feedback on 'Q503 How do you handle runtime errors in JavaScript?'

©2018 Martin Webb