The onerror event

The onerror event may be triggered when a JavaScript error occurs on the page.

✓ Tip

  • It can be polite to set onerror = null; in complex pages you put on the Web. With this line of code on your page, some error messages will not be displayed to the user in the unfortunate event that there’s a problem—but which errors will be hidden depends on the browser.

Get JavaScript and Ajax for the Web: Visual QuickStart Guide, Seventh Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.