onmessage
message 事件是在窗口接受到消息(例如,从另一个浏览器上下文中调用 Window.postMessage())时,在 Window 对象上触发的事件。
语法
window.addEventListener('message', function(event) { ... })
window.onmessage = function(event) { ... }
规范
| Specification |
|---|
| HTML Standard # event-message |
| HTML Standard # handler-window-onmessage |
浏览器兼容性
BCD tables only load in the browser