Class

io.scalajs.dom

EventSource

Related Doc: package dom

Permalink

class EventSource extends Object with EventTarget

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.

Annotations
@RawJSType() @native() @JSGlobal( "EventSource" )
See also

https://developer.mozilla.org/en-US/docs/Web/API/EventSource

Linear Supertypes
EventTarget, Object, Any, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. EventSource
  2. EventTarget
  3. Object
  4. Any
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new EventSource(url: String)

    Permalink

    url

    A DOMString representing the URL of the source.

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def addEventListener(type: String, listener: Function, useCapture: Boolean): Unit

    Permalink

    Register an event handler of a specific event type on the EventTarget.

    Register an event handler of a specific event type on the EventTarget.

    listener

    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.

    useCapture

    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.

    Definition Classes
    EventTarget
  5. def addEventListener(type: String, listener: Function, options: |[EventTargetOptions, RawOptions]): Unit

    Permalink

    Register an event handler of a specific event type on the EventTarget.

    Register an event handler of a specific event type on the EventTarget.

    listener

    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.

    options

    An options object that specifies characteristics about the event listener.

    Definition Classes
    EventTarget
  6. def addEventListener(type: String, listener: Function): Unit

    Permalink

    Register an event handler of a specific event type on the EventTarget.

    Register an event handler of a specific event type on the EventTarget.

    listener

    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.

    Definition Classes
    EventTarget
  7. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  8. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. def close(): Unit

    Permalink

    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.

  10. def dispatchEvent(event: Event): Boolean

    Permalink

    Dispatch an event to this EventTarget.

    Dispatch an event to this EventTarget.

    event

    event is the Event object to be dispatched.

    returns

    false if event is cancelable and at least one of the event handlers which handled this event called Event.preventDefault(). Otherwise it returns true.

    Definition Classes
    EventTarget
  11. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  12. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  13. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  14. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  15. def hasOwnProperty(v: String): Boolean

    Permalink
    Definition Classes
    Object
  16. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  17. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  18. def isPrototypeOf(v: Object): Boolean

    Permalink
    Definition Classes
    Object
  19. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  20. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  21. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  22. var onerror: Function

    Permalink

    Is an EventHandler being called when an error occurs and the error event is dispatched on this object.

  23. var onmessage: Function

    Permalink

    Is an EventHandler being called when a message event is received, that is when a message is coming from the source.

  24. var onopen: Function

    Permalink

    Is an EventHandler being called when an open event is received, that is when the connection was just opened.

  25. def propertyIsEnumerable(v: String): Boolean

    Permalink
    Definition Classes
    Object
  26. def readyState: Int

    Permalink

    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).

  27. def removeEventListener(type: String, listener: Function, useCapture: Boolean): Unit

    Permalink

    Removes an event listener from the EventTarget.

    Removes an event listener from the EventTarget.

    listener

    The EventListener function to remove from the event target.

    useCapture

    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.

    Definition Classes
    EventTarget
  28. def removeEventListener(type: String, listener: Function, options: |[EventTargetOptions, RawOptions]): Unit

    Permalink

    Removes an event listener from the EventTarget.

    Removes an event listener from the EventTarget.

    listener

    The EventListener function to remove from the event target.

    options

    An options object that specifies characteristics about the event listener.

    Definition Classes
    EventTarget
  29. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  30. def toLocaleString(): String

    Permalink
    Definition Classes
    Object
  31. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  32. val url: String

    Permalink

    A DOMString representing the URL of the source.

  33. def valueOf(): Any

    Permalink
    Definition Classes
    Object
  34. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  35. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  36. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from EventTarget

Inherited from Object

Inherited from Any

Inherited from AnyRef

Inherited from Any

Ungrouped