From 9b97f9f4a1f580cbf582fb4bebabbccaab8e5dda Mon Sep 17 00:00:00 2001 From: MDN Date: Thu, 16 Dec 2021 00:52:08 +0000 Subject: [CRON] sync translated content --- files/zh-cn/web/api/websocket/onopen/index.html | 41 ------------------------- 1 file changed, 41 deletions(-) delete mode 100644 files/zh-cn/web/api/websocket/onopen/index.html (limited to 'files/zh-cn/web/api/websocket/onopen') diff --git a/files/zh-cn/web/api/websocket/onopen/index.html b/files/zh-cn/web/api/websocket/onopen/index.html deleted file mode 100644 index 067c9057bc..0000000000 --- a/files/zh-cn/web/api/websocket/onopen/index.html +++ /dev/null @@ -1,41 +0,0 @@ ---- -title: WebSocket.onopen -slug: Web/API/WebSocket/onopen -translation_of: Web/API/WebSocket/onopen ---- -

WebSocket.onopen属性定义一个事件处理程序,当{{domxref("WebSocket")}} 的连接状态{{domxref("WebSocket.readyState","readyState")}} 变为{{domxref("WebSocket.readyState","1")}}时调用;这意味着当前连接已经准备好发送和接受数据。这个事件处理程序通过 {{domxref("事件")}}(建立连接时)触发。

- -

语法

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

返回值

- -

An {{domxref("EventListener")}}.

- -

规范

- - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#handler-websocket-onopen', 'WebSocket: onopen')}}{{Spec2('HTML WHATWG')}}Initial definition
- -

浏览器兼容性

- - - -

{{Compat("api.WebSocket.onopen")}}

-- cgit v1.2.3-54-g00ecf