HTML onmessageerror Event Attribute
HTML Event AttributeThis event attribute is supported by all modern browsers.
Description
The onmessageerror event attribute is used on the <body> element (or as window.onmessageerror) and runs a script when the window receives a message that cannot be deserialized, for example a SharedArrayBuffer sent to a page that is not cross-origin isolated.
It is the error counterpart of onmessage, which fires for messages sent with postMessage(). The same event exists on Worker, MessagePort and BroadcastChannel objects. In practice it fires rarely, but handling it avoids losing messages silently.
Syntax
<body onmessageerror="script">
Values
- scriptThe name of the script to use when the event has been triggered.
Example
Browser Support
The following information will show you the current browser support for the HTML onmessageerror event attribute. Hover over a browser icon to see the version that first introduced support for this HTML event attribute.
This event attribute is supported by all modern browsers.
Desktop





Tablets & Mobile






-
Supported Unknown Not supported
Sponsors
Password Manager
PasswordPal stores your passwords and private notes behind encryption that happens in your browser.
Copy Paste List
Copy and paste or download lists in your preferred format, including plain text, PDF, or HTML.
Unicode Characters & Emojis
Search all Unicode characters and emojis plus other tools.
Check Shortened URLs
Expand shortened URLs to view the destination link.
Advertise Here
Advertise your company and products here!