WebSocket.onopen

这篇翻译不完整。请帮忙从英语翻译这篇文章

WebSocket.onopen属性返回事件监听,当WebSocket 的连接状态由readyState 变为“OPEN”状态时调用;这一行为也表明当前连接已经准备好发送消息和接受消息。这个事件有个简单的名字: “open”

 

语法

aWebSocket.onopen = function(event) {
  console.log("WebSocket is open now.");
};

An EventListener.

详述

Specification Status Comment
HTML Living Standard
WebSocket: onopen
Living Standard Initial definition

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
Basic supportChrome Full support YesEdge ? Firefox Full support YesIE ? Opera Full support YesSafari ? WebView Android ? Chrome Android Full support YesEdge Mobile ? Firefox Android Full support YesOpera Android ? Safari iOS ? Samsung Internet Android ?

Legend

Full support  
Full support
Compatibility unknown  
Compatibility unknown

文档标签和贡献者

此页面的贡献者: suciy
最后编辑者: suciy,