Categorized | Ajax

Object XMLHttpRequest

Object XMLHttpRequest Memiliki banyak properties, diantaranya adalah :
onreadystatechange : Callback function; the function assigned to this property is called whenever readyState changes.

readyState : Number; 0 means uninitialized, open( ) has not yet been called; 1 means loading, send( ) has not been called; 2 means loaded, send( ) has been called, and headers/status are available; 3 means interactive, responseText holds partial data; 4 means completed.

responseText : string; the plain text of the response.

responseXML : DOM Document object; an XML return value.

status : Response status code, such as 200 (Okay) or 404 (Not Found).

statusText : string; the text associated with the HTTP response status.

The methods supported include:

abort( ) : void; cancels the HTTP request.

getAllResponseHeaders( ) : string; returns all of the response headers in a preformatted string

getResponseHeader(string header) : string; returns the value of the specified header.

open(string url,string asynch) : void; prepares the HTTP request and specifies whether it is asynchronous or not.

send(string) : void; sends the HTTP request.

setHeader(string header,string value) : void; sets a request header, but you must call open( ) first!

Leave a Reply

  • Popular
  • Comments
  • Tags
  • Subscribe
Advertise Here

Category

Tag Cloud