Class/Object

org.scalajs.dom.raw

XMLHttpRequest

Related Docs: object XMLHttpRequest | package raw

Permalink

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() @native() @JSGlobal()
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
Visibility
  1. Public
  2. All

Instance Constructors

  1. new XMLHttpRequest()

    Permalink

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 abort(): Unit

    Permalink

    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

    Permalink

    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

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

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

    Permalink
  9. def dispatchEvent(evt: Event): Boolean

    Permalink

    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

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

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

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

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

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

    Permalink
  16. def hasOwnProperty(v: String): Boolean

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

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

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

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

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

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

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

    Permalink
  24. var onerror: Function1[ErrorEvent, _]

    Permalink
  25. var onload: Function1[Event, _]

    Permalink
  26. var onloadend: Function1[ProgressEvent, _]

    Permalink
  27. var onloadstart: Function1[Any, _]

    Permalink
  28. var onprogress: Function1[ProgressEvent, _]

    Permalink
  29. var onreadystatechange: Function1[Event, _]

    Permalink
  30. var ontimeout: Function1[Event, _]

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

    Permalink

    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

    Permalink
    Definition Classes
    Object
  33. def readyState: Int

    Permalink

    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[T <: Event](type: String, listener: Function1[T, _], useCapture: Boolean = js.native): Unit

    Permalink

    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

    Permalink

    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

    Permalink

    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

    Permalink

    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 responseURL: UndefOr[String]

    Permalink

    Returns the serialized URL of the response or the empty string if the URL is null.

    Returns the serialized URL of the response or the empty string if the URL is null. If the URL is returned, URL fragment if present in the URL will be stripped away. The value of responseURL will be the final URL obtained after any redirects.

    This property should be a String, but it isn't implemented by IE, even as new as IE11, hence it must be UndefOr.

    MDN

  39. def responseXML: Document

    Permalink

    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

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

    Permalink

    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

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

    Permalink

    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

  42. def status: Int

    Permalink

    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

  43. def statusText: String

    Permalink

    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

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

    Permalink
    Definition Classes
    AnyRef
  45. var timeout: Double

    Permalink

    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

  46. def toLocaleString(): String

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

    Permalink
    Definition Classes
    AnyRef → Any
  48. var upload: XMLHttpRequestEventTarget

    Permalink

    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

  49. def valueOf(): Any

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

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

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

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

    Permalink

    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