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.
當伺服器傳來資料時,客戶端會收到一個 MessageEvent
,由 WebSocket
物件 onmessage
表示的監聽器接收。
屬性
屬性 | 形態 | 描述 |
---|---|---|
data |
DOMString | Blob | ArrayBuffer |
伺服器傳來的資料。 |
規範
Specification |
---|
HTML # the-messageevent-interface |
瀏覽器兼容
Report problems with this compatibility data on GitHubdesktop | mobile | server | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
MessageEvent | ||||||||||||||
MessageEvent() constructor | ||||||||||||||
data | ||||||||||||||
initMessageEvent | ||||||||||||||
lastEventId | ||||||||||||||
origin | ||||||||||||||
ports | ||||||||||||||
source | ||||||||||||||
userActivation |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No support
- Non-standard. Check cross-browser support before using.
- Deprecated. Not for use in new websites.
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.