onopen event
Fires when a WebSocket is connected.
Syntax
| Event Property | object.onopen = handler; |
|---|---|
| addEventListener Method | object.addEventListener("open", handler, useCapture) |
Event handler parameters
- handler [in]
-
Type: Function
Event handler to call when a WebSocket connect is made.
Remarks
This event fires only when a connection is made. To determine if a connection is still open, use readyState. If you provide a protocol when opening a WebSocket, it is recommended that the app check the protocol property to ensure the protocol was accepted by the server.
See also
Show: