MessageEvent

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

io error: No such file or directory (os error 2) (/home/runner/work/yari/yari/mdn/translated-content/files/zh-tw/web/api/html_dom_api/index.md)

當伺服器傳來資料時,客戶端會收到一個 MessageEvent,由 WebSocket 物件 onmessage 表示的監聽器接收。

屬性

屬性 形態 描述
data DOMString | Blob | ArrayBuffer 伺服器傳來的資料。

規範

Specification
HTML Standard
# the-messageevent-interface

瀏覽器兼容

BCD tables only load in the browser

參見