![]() |
VOOZH | about |
The onmessage Event in HTML DOM used when an object has received some message through an event source. The event object for onmessage Event supports the following schemes:
Note: Server-Sent Events are not supported in Internet Explorer.
Syntax:
object.onmessage = function(){myScript}; object.addEventListener("message", myScript);
Example 1:
Output:
Example 2: Using the addEventListener() method
Output:
Supported browsers: The browser supported by onmessage Event are listed below: