Name

CloseEvent — specifies whether a WebSocket closed cleanly

Inherits from

Event

Synopsis

When a WebSocket connection closes, a nonbubbling, noncancelable close event is fired on the WebSocket object and an associated CloseEvent object is passed to any registered event handlers.

Properties

readonly boolean wasClean

If the WebSocket connection closed in the controlled way specified by WebSocket protocol, with acknowledgment between client and server, the close is said to be clean, and this property will be true. If this property is false, the WebSocket may have closed as the result of a network error of some sort.

Get JavaScript: The Definitive Guide, 6th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.