Register an event handler of a specific event type on the EventTarget.
Register an event handler of a specific event type on the EventTarget.
The object that receives a notification (an object that implements the Event interface) when an event of the specified type occurs. This must be an object implementing the EventListener interface, or simply a JavaScript function.
A Boolean that indicates that events of this type will be dispatched to the registered listener before being dispatched to any EventTarget beneath it in the DOM tree. Events that are bubbling upward through the tree will not trigger a listener designated to use capture. Event bubbling and capturing are two ways of propagating events that occur in an element that is nested within another element, when both elements have registered a handle for that event. The event propagation mode determines the order in which elements receive the event. See DOM Level 3 Events and JavaScript Event order for a detailed explanation. If not specified, useCapture defaults to false.
Register an event handler of a specific event type on the EventTarget.
Register an event handler of a specific event type on the EventTarget.
The object that receives a notification (an object that implements the Event interface) when an event of the specified type occurs. This must be an object implementing the EventListener interface, or simply a JavaScript function.
An options object that specifies characteristics about the event listener.
Register an event handler of a specific event type on the EventTarget.
Register an event handler of a specific event type on the EventTarget.
The object that receives a notification (an object that implements the Event interface) when an event of the specified type occurs. This must be an object implementing the EventListener interface, or simply a JavaScript function.
Closes the connection, if any, and sets the readyState attribute to CLOSED.
Closes the connection, if any, and sets the readyState attribute to CLOSED. If the connection is already closed, the method does nothing.
Dispatch an event to this EventTarget.
Dispatch an event to this EventTarget.
event is the Event object to be dispatched.
false if event is cancelable and at least one of the event handlers which handled this event called Event.preventDefault(). Otherwise it returns true.
Is an EventHandler being called when an error occurs and the error event is dispatched on this object.
Is an EventHandler being called when a message event is received, that is when a message is coming from the source.
Is an EventHandler being called when an open event is received, that is when the connection was just opened.
Read only: An unsigned short representing the state of the connection.
Read only: An unsigned short representing the state of the connection. Possible values are CONNECTING (0), OPEN (1), or CLOSED (2).
Removes an event listener from the EventTarget.
Removes an event listener from the EventTarget.
The EventListener function to remove from the event target.
Specifies whether the EventListener to be removed is registered as a capturing listener or not. If this parameter is absent, a default value of false is assumed. If a listener is registered twice, one with capture and one without, remove each one separately. Removal of a capturing listener does not affect a non-capturing version of the same listener, and vice versa.
Removes an event listener from the EventTarget.
Removes an event listener from the EventTarget.
The EventListener function to remove from the event target.
An options object that specifies characteristics about the event listener.
A DOMString representing the URL of the source.
The EventSource interface is used to receive server-sent events. It connects to a server over HTTP and receives events in text/event-stream format without closing the connection.
https://developer.mozilla.org/en-US/docs/Web/API/EventSource