Ajax-asynchronous communication object

Source: Internet
Author: User

 

Standard XMLHttpRequest operations

 
Abort ()
Stop current request
 
GetAllResponseHeaders ()
Returns all Response Headers of an HTTP request as key/value pairs.
 
GetResponseHeader ("Header ")
Returns the string value of the specified header.
 
Void open (string method, string URL, Boolean asynch)
Create a call to the server. The method parameter can be get, post, or put. URL parameters can be relative URLs or absolute URLs. This method also includes three optional parameters.
 
Send (content)
Sends a request to the server. The parameter can be an instance of the DOM object, an input stream, or a string
 
SetRequestHeader ("Header", "value ")
Set the specified header to the provided value. You must call open () before setting any header ()
 

Standard XMLHttpRequest attributes

Genus
Description
 
Onreadystatechange
This event processor is triggered when each state changes. A JavaScript function is usually called.
 
Readystate
Request status. Five optional values: 0 = not initialized, 1 = loading, 2 = loaded, 3 = interaction, 4 = completed
 
Responsetext
Server Response, represented as a string
 
Responsexml
Server Response, which is expressed as XML. This object can be parsed as a DOM object.
 
Status
HTTP status code of the server (200 corresponds to OK, 404 corresponds to not found (not found), and so on)
 
Statustext
The corresponding text of the HTTP status code (OK or not found (not found) and so on)
 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.