org.scalajs.dom.raw

XMLHttpRequest

Related Docs: object XMLHttpRequest | package raw

class XMLHttpRequest extends EventTarget

XMLHttpRequest is a JavaScript object that was designed by Microsoft and adopted by Mozilla, Apple, and Google. It's now being standardized in the W3C. It provides an easy way to retrieve data from a URL without having to do a full page refresh. A Web page can update just a part of the page without disrupting what the user is doing. XMLHttpRequest is used heavily in AJAX programming.

Despite its name, XMLHttpRequest can be used to retrieve any type of data, not just XML, and it supports protocols other than HTTP (including file and ftp).

MDN

Annotations
@RawJSType()
Linear Supertypes
EventTarget, Object, Any, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. XMLHttpRequest
  2. EventTarget
  3. Object
  4. Any
  5. AnyRef
  6. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new XMLHttpRequest()

Value Members

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

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

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

    Definition Classes
    AnyRef → Any
  4. def abort(): Unit

    Aborts the request if it has already been sent.

    Aborts the request if it has already been sent.

    MDN

  5. def addEventListener[T <: Event](type: String, listener: Function1[T, _], useCapture: Boolean = js.native): Unit

    The EventTarget.addEventListener() method registers the specified listener on the EventTarget it's called on.

    The EventTarget.addEventListener() method registers the specified listener on the EventTarget it's called on. The event target may be an Element in a document, the Document itself, a Window, or any other object that supports events (such as XMLHttpRequest).

    MDN

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

    Definition Classes
    Any
  7. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def create(): XMLHttpRequest

  9. def dispatchEvent(evt: Event): Boolean

    Dispatches an Event at the specified EventTarget, invoking the affected EventListeners in the appropriate order.

    Dispatches an Event at the specified EventTarget, invoking the affected EventListeners in the appropriate order. The normal event processing rules (including the capturing and optional bubbling phase) apply to events dispatched manually with dispatchEvent().

    MDN

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

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

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

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  13. def getAllResponseHeaders(): String

  14. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  15. def getResponseHeader(header: String): String

  16. def hasOwnProperty(v: String): Boolean

    Definition Classes
    Object
  17. def hashCode(): Int

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

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

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

    Definition Classes
    AnyRef
  21. final def notify(): Unit

    Definition Classes
    AnyRef
  22. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  23. var onabort: Function1[Any, _]

  24. var onerror: Function1[ErrorEvent, _]

  25. var onload: Function1[Event, _]

  26. var onloadend: Function1[ProgressEvent, _]

  27. var onloadstart: Function1[Any, _]

  28. var onprogress: Function1[ProgressEvent, _]

  29. var onreadystatechange: Function1[Event, _]

  30. var ontimeout: Function1[Event, _]

  31. def open(method: String, url: String, async: Boolean = js.native, user: String = js.native, password: String = js.native): Unit

    Initializes a request.

    Initializes a request. This method is to be used from JavaScript code; to initialize a request from native code, use openRequest()instead.

    MDN

  32. def propertyIsEnumerable(v: String): Boolean

    Definition Classes
    Object
  33. def readyState: Int

    The state of the request: Value State Description 0 UNSENT open()has not been called yet.

    The state of the request: Value State Description 0 UNSENT open()has not been called yet. 1 OPENED send()has not been called yet. 2 HEADERS_RECEIVED send() has been called, and headers and status are available. 3 LOADING Downloading; responseText holds partial data. 4 DONE The operation is complete.

    MDN

  34. def removeEventListener(type: String, listener: Function1[Event, _], useCapture: Boolean = js.native): Unit

    Removes the event listener previously registered with EventTarget.addEventListener.

    Removes the event listener previously registered with EventTarget.addEventListener.

    MDN

    Definition Classes
    EventTarget
  35. def response: Any

    The response entity body according to responseType, as an ArrayBuffer, Blob, Document, JavaScript object (for "json"), or string.

    The response entity body according to responseType, as an ArrayBuffer, Blob, Document, JavaScript object (for "json"), or string. This is null if the request is not complete or was not successful.

    MDN

  36. def responseText: String

    The response to the request as text, or null if the request was unsuccessful or has not yet been sent.

    The response to the request as text, or null if the request was unsuccessful or has not yet been sent.

    MDN

  37. var responseType: String

    Can be set to change the response type.

    Can be set to change the response type. Value Data type of response property "" (empty string) String (this is the default) "arraybuffer" ArrayBuffer "blob" Blob "document" Document "json" JavaScript object, parsed from a JSON string returned by the server "text" String "moz-blob" Used by Firefox to allow retrieving partial Blob data from progress events. This lets your progress event handler start processing data while it's still being received. "moz-chunked-text" Similar to "text", but is streaming. This means that the value in response is only available during dispatch of the "progress" event and only contains the data received since the last "progress" event. When response is accessed during a "progress" event it contains a string with the data. Otherwise it returns null. This mode currently only works in Firefox. "moz-chunked-arraybuffer" Similar to "arraybuffer", but is streaming. This means that the value in response is only available during dispatch of the "progress" event and only contains the data received since the last "progress" event. When response is accessed during a "progress" event it contains a string with the data. Otherwise it returns null. This mode currently only works in Firefox. Note: Starting with Gecko 11.0 (Firefox 11.0 / Thunderbird 11.0 / SeaMonkey 2.8), as well as WebKit build 528, these browsers no longer let you use the responseType attribute when performing synchronous requests. Attempting to do so throws an NS_ERROR_DOM_INVALID_ACCESS_ERR exception. This change has been proposed to the W3C for standardization.

    MDN

  38. def responseXML: Document

    The response to the request as a DOM Document object, or null if the request was unsuccessful, has not yet been sent, or cannot be parsed as XML or HTML.

    The response to the request as a DOM Document object, or null if the request was unsuccessful, has not yet been sent, or cannot be parsed as XML or HTML. The response is parsed as if it were a text/xml stream. When the responseType is set to "document" and the request has been made asynchronously, the response is parsed as a text/html stream. Note: If the server doesn't apply the text/xml Content-Type header, you can use overrideMimeType()to force XMLHttpRequest to parse it as XML anyway.

    MDN

  39. def send(data: Any = js.native): Unit

    Sends the request.

    Sends the request. If the request is asynchronous (which is the default), this method returns as soon as the request is sent. If the request is synchronous, this method doesn't return until the response has arrived.

    MDN

  40. def setRequestHeader(header: String, value: String): Unit

    Sets the value of an HTTP request header.

    Sets the value of an HTTP request header. You must call setRequestHeader() after open(), but before send(). If this method is called several times with the same header, the values are merged into one single request header.

    MDN

  41. def status: Int

    The status of the response to the request.

    The status of the response to the request. This is the HTTP result code (for example, status is 200 for a successful request).

    MDN

  42. def statusText: String

    The response string returned by the HTTP server.

    The response string returned by the HTTP server. Unlike status, this includes the entire text of the response message ("200 OK", for example).

    MDN

  43. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  44. var timeout: Double

    The number of milliseconds a request can take before automatically being terminated.

    The number of milliseconds a request can take before automatically being terminated. A value of 0 (which is the default) means there is no timeout. Note: You may not use a timeout for synchronous requests with an owning window.

    MDN

  45. def toLocaleString(): String

    Definition Classes
    Object
  46. def toString(): String

    Definition Classes
    AnyRef → Any
  47. var upload: XMLHttpRequestEventTarget

    The upload process can be tracked by adding an event listener to upload.

    The upload process can be tracked by adding an event listener to upload.

    MDN

  48. def valueOf(): Any

    Definition Classes
    Object
  49. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  52. var withCredentials: Boolean

    Indicates whether or not cross-site Access-Control requests should be made using credentials such as cookies or authorization headers.

    Indicates whether or not cross-site Access-Control requests should be made using credentials such as cookies or authorization headers. The default is false. Note: This never affects same-site requests. Note: Starting with Gecko 11.0 (Firefox 11.0 / Thunderbird 11.0 / SeaMonkey 2.8), Gecko no longer lets you use the withCredentials attribute when performing synchronous requests. Attempting to do so throws an NS_ERROR_DOM_INVALID_ACCESS_ERR exception.

    MDN

Inherited from EventTarget

Inherited from Object

Inherited from Any

Inherited from AnyRef

Inherited from Any

Ungrouped