When the server sends data through the WebSocket, the WebSocket fires a message
event, with an associated
property refers to the received
constructor returns before the connection to the specified
lished. When the connection handshake completes and the WebSocket is ready to send
and receive data, an open event is fired. The associated event object is a simple Event.
a web browser window, tab, or frame
The Window object represents a browser window, tab, or frame. It is documented in detail
expressions are evaluated in the context of the current Window object. This means that no
special syntax is required to refer to the current window, and you can use the properties of
that window object as if they were global variables. For example, you can write
. Similarly, you can use the methods of the current window object as if
they were functions: e.g.,
Some of the properties and methods of this object actually query or manipulate the browser
window in some way. Others are defined here simply because this is the global object. In
addition to the properties and methods listed here, the Window object also implements all
in Part III for details.
Web browsers fire many kinds of events at windows. This means that the Window object
defines quite a few event handlers, and that Window objects implement the methods defined
The Window object has
properties that refer to the window object itself. You
can use these to make the current window reference explicit rather than implicit.
A Window can contain other Window objects, typically in the form of
Window is an array-like object of nested Window objects. Rather than indexing a Window
object directly, however, you typically use its self-referential
property as if it were the
array-like object. The
properties of a Window refer to the directly containing
window and top-level ancestor window.
New top-level browser windows are created with the
method. When you call
this method, save the return value of the
call in a variable and use that variable to
reference the new window. The
property of the new window is a reference back to the
window that opened it.
In addition to the properties listed here, document content displayed within the window
causes new properties to come into existence. As explained in §14.7, you can refer to an
element within the document by using the value of the element’s
attribute as a property of
the window (and since the window is the global object, its properties are global variables).