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

Q503 How do you handle runtime errors in JavaScript?

irt.org | Knowledge Base | JavaScript | General | Q503 [ previous next ]

Q503 How do you handle runtime errors in JavaScript?

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?'


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.