GO-Ve01
ServicesDevelopersBooksDictionaryPapersWikidataEncyclopediaSearchBabelCareersDeck

Search e01

One query across the encyclopedia, books, dictionary, papers, Wikidata and the developer library. Every hit carries its source.

6 results across 6 corpora for CloseEvent: code property.

Developer library 6

Firefox 41 release notes for developers

, Document.execCommand() when the command is not supported or enabled ([Firefox bug 1027560](https://bugzil.la/1027560)). #### Events - The non-standard `initCloseEvent()` method of the CloseEvent event and the ability to create a CloseEvent using the document.createEvent('CloseEvent') method has been removed; use the standard constructor, CloseEvent() instead ([Firefox bug 1161950](https://bugzil.la/1161950)). - O

Firefox 8 release notes for developers

PI/WebSocket) object's [`close()`](/docs/Web/API/WebSocket/close) method now matches the current draft of the standard, and close events now properly use the [`CloseEvent`](/docs/Web/API/CloseEvent) interface. - The [`WebSocket`](/docs/Web/API/WebSocket) object's `extensions` attribute is now supported. - The WebSocket constructor now supports an array of protocols as well as a single protocol string. - Mixed content

MDN Web Docs mirror · CC BY-SA 2.5 (MDN) · https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Releases/8

Using WebSocketStream to write a client

is safe to do so. ## Closing the connection To close a connection, call the WebSocketStream.close() method, optionally passing a [closing code](/docs/Web/API/CloseEvent/code#value) and reason: ```js wss.close({ closeCode: 4000, reason: "Night draws to a close", }); ``` > [!NOTE] > Depending on the server setup and status code you use, the server may choose to ignore a custom code in favor of a valid code that

CloseEvent

Websockets API A `CloseEvent` is sent to clients using WebSockets when the connection is closed. This is delivered to the listener indicated by the `WebSocket` object's `onclose` attribute. ## Constructor - CloseEvent() - : Creates a new `CloseEvent`. ## Instance properties _This interface also inherits properties from its parent, Event._ - CloseEvent.code - : Returns an `unsigned short` containing the c

MDN Web Docs mirror · CC BY-SA 2.5 (MDN) · https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent

CloseEvent: CloseEvent() constructor

Websockets API The **`CloseEvent()`** constructor creates a new CloseEvent object. ## Syntax ```js-nolint new CloseEvent(type) new CloseEvent(type, options) ``` ### Parameters - `type` - : A string with the name of the event. It is case-sensitive and browsers always set it to `close`. - `options` - : An object that, _in addition of the properties defined in Event()_, has the following properties: -

CloseEvent: code property

Websockets API The **`code`** read-only property of the CloseEvent interface returns a [WebSocket connection close code](https://www.rfc-editor.org/info/rfc6455/#section-7.1.5) indicating the reason the connection was closed. ## Value An integer [WebSocket connection close code](https://www.rfc-editor.org/info/rfc6455/#section-7.1.5) in the range `1000` - `4999`, indicating the reason the connection was closed. <

MDN Web Docs mirror · CC BY-SA 2.5 (MDN) · https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent/code

JSON results · Services directory