Some common methods of AJAX

Source: Internet
Author: User
Tags http authentication

abort ()Stop the current request
getallresponseheaders ()Returns all the response header information that contains the HTTP request, where the response header includes content such as Content-length,date,uri.
getResponseHeader (String header)Returns the value of the header corresponding to the key name specified in the response header of the HTTP request
Open (String method,string url,boolean asynch,string username,string password)Establish a call to the server. Where method represents the HTTP invocation methods. Generally, the "GET", "post" URL represents the address of the calling server Asynch whether it is asynchronous, true indicates that the two parameters can not be specified asynchronously, username and password represent the user name and password, respectively. Provide the user name and password required by the HTTP authentication mechanism
Send (content)The request is made to the server, and if it is asynchronous, the method returns immediately. Content can be unspecified, and its contents can be DOM objects, input streams, or strings.
onreadystatechangeAn event trigger that requests a state change (this method is called when readystate changes). is usually a JavaScript function
readyStateReadyState a change, the callback function is called
Request Status
0= not initialized.
After the 1=open method is successfully called.
The 2= server has answered the client's request.
3= in the interaction. The HTTP header information has been received and the response data has not been received.
4= completed. Data reception complete.
ResponseTextThe text content returned by the server
ResponsexmlXML content of the compatible DOM returned by the server
StatusThe server returns a status code. 200 means "success", 404 means "not found" and 500 means "internal error"
StatusTextThe server returns text information for the status code.

Some common methods of AJAX

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.