On this Page

    XMLHttpRequest (Send/Receive HTML Pages)

    (Windows only)

    This class allows the use of the standard XMLHttpRequest functions that allow the posting and receiving of HTML pages.

    Usage

    To use the XMLHttpRequest class you must first create an instance of the class:

    var http = new XMLHttpRequest;

    You can now use the HTTP object to invoke the various functions below.

    Functions

    http.readyState

    (As of 3.2.001.03) Represents the state of the request. Essential for "async" calls. Get data when it is "4" (COMPLETED). Values:

    0 (UNINITIALIZED): The object has been created, but not initialized (the open method has not been called).
    1 (LOADING): The object has been created, but the send method has not been called.
    2 (LOADED): The send method has been called, but the status and headers are not yet available.
    3 (INTERACTIVE): Some data has been received. Calling the responseBody and responseText properties at this state to obtain partial results will return an error because status and response headers are not fully available.
    4 (COMPLETED): All the data has been received, and the complete data is available in the responseBody and responseText properties.

    http.status

    (As of 3.2.001.03) Represents the HTTP status code returned by a request. 

    http.statusText

    (As of 3.2.001.03) Represents the HTTP response line status.

    http.getAllResponseHeaders()

    Get all response header name/value pairs. This routine returns all name/value pairs in a single string. Each pair is delimited by a carriage return/linefeed (CR/LF) sequence.

    http.getResponseHeader(name)

    Get a single named response header value.
    http.open()Open a link to an HTTP web site.
    http.send()Send the request and receive a response.
    http.setRequestHeader()Add a custom HTTP header.
    http.responseTextGet the textual response made by the invoked URL. See the example under http.responseText.