WebSocket.onclose property is an EventHandler that is called when the WebSocket connection's readyState changes to CLOSED . It is called with a CloseEvent .

句法

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

An EventListener .

规范

规范 状态 注释
HTML 实时标准
The definition of 'WebSocket: onclose' in that specification.
实时标准 初始定义

元数据

  • 最后修改: