This page is In Progress

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

MessageEvent

Summary

A MessageEvent is sent to clients using WebSockets when data is received from the server. This is delivered to the listener indicated by the WebSocket object’s onmessage attribute.

Properties

html/elements/data
The data from the server.

Methods

No methods.

Events

No events.

Examples



socket.onmessage = function (event) {
  console.log(event.data);
}

Attributions

  • Mozilla Developer Network cc-by-sa-small-wpd.svg: Article