未验证 提交 56bafd53 编写于 作者: Z zengyawen 提交者: Gitee

update zh-cn/application-dev/reference/apis/js-apis-webSocket.md.

Signed-off-by: Nzengyawen <zengyawen1@huawei.com>
上级 fa5a707e
...@@ -47,7 +47,7 @@ ws.on('message', (err, value) => { ...@@ -47,7 +47,7 @@ ws.on('message', (err, value) => {
} }
}); });
ws.on('close', (err, value) => { ws.on('close', (err, value) => {
console.log("on close, code is " + value['code'] + ", reason is " + value['reason']); console.log("on close, code is " + value.code + ", reason is " + value.reason);
}); });
ws.on('error', (err) => { ws.on('error', (err) => {
console.log("on error, error:" + JSON.stringify(err)); console.log("on error, error:" + JSON.stringify(err));
...@@ -505,7 +505,7 @@ on\(type: 'close', callback: AsyncCallback<\{ code: number, reason: string \}\>\ ...@@ -505,7 +505,7 @@ on\(type: 'close', callback: AsyncCallback<\{ code: number, reason: string \}\>\
```js ```js
let ws = webSocket.createWebSocket(); let ws = webSocket.createWebSocket();
ws.on('close', (err, value) => { ws.on('close', (err, value) => {
console.log("on close, code is " + value['code'] + ", reason is " + value['reason']); console.log("on close, code is " + value.code + ", reason is " + value.reason);
}); });
``` ```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册