From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../zh-cn/web/api/websocket/readystate/index.html | 60 ++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 files/zh-cn/web/api/websocket/readystate/index.html (limited to 'files/zh-cn/web/api/websocket/readystate/index.html') diff --git a/files/zh-cn/web/api/websocket/readystate/index.html b/files/zh-cn/web/api/websocket/readystate/index.html new file mode 100644 index 0000000000..e4d7bd23fb --- /dev/null +++ b/files/zh-cn/web/api/websocket/readystate/index.html @@ -0,0 +1,60 @@ +--- +title: WebSocket.readyState +slug: Web/API/WebSocket/readyState +tags: + - Web API + - WebSocket +translation_of: Web/API/WebSocket/readyState +--- +

{{APIRef("Web Sockets API")}}

+ +

概要

+ +

返回当前 {{domxref("WebSocket")}} 的链接状态,只读。

+ +

语法

+ +
var readyState = WebSocket.readyState;
+ +

+ +

以下其中之一

+ +
+
0 (WebSocket.CONNECTING)
+
正在链接中
+
1 (WebSocket.OPEN)
+
已经链接并且可以通讯
+
2 (WebSocket.CLOSING)
+
连接正在关闭
+
3 (WebSocket.CLOSED)
+
连接已关闭或者没有链接成功
+
+ +

Specifications

+ + + + + + + + + + + + + + +
SpecificationStatusComment
HTML Living Standard
+ The definition of 'WebSocket.readyState' in that specification.
Living StandardInitial definition
+ +

Browser compatibility

+ + + +

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

+ +

+ +

-- cgit v1.2.3-54-g00ecf