2015-03-06--ajax Foundation

Source: Internet
Author: User

IE6 must use the Microsoft.XMLHTTP ActiveX component to instantiate an object IE7 the XMLHttpRequest object has been implemented

var request = new ActiveXObject ("Microsoft.XMLHTTP"); IE6
var request= new XMLHttpRequest ();

Common methods for Request objects
Open (method, URL, isasynchronous); The third parameter, True/false, is asynchronous
setRequestHeader (label, value); Must be placed after open, send ();
Send (content); Content content is optional, such as the contents of a POST request
Abort (); Used to stop the current request
getAllResponseHeaders (); Returns a complete set of header information as a string
getResponseHeader (label); Returns a separate string value for the specified header

Request Object Event
onReadyStateChange
ReadyState
0: not yet initialized
1: Load in
2: Load Complete
3: Interaction
4: Complete
A string representation of the data returned in the ResponseText response
Responsexml document objects that are compatible with the DOM core must have the Content-type header information for the response set to Application/xml
Status indicates the number code of the request state 404 (OK) ...
StatusText a piece of information related to the status code

Common Request Method:
Get, a request to obtain header and other information from the server
POST, a request to modify information on the server
Head, which is used for the same request as get, but the head contains only the header information associated with the request and does not contain the requested body
PUT, for requests that want to store information in a particular location on the server
Delete, for requests that you want to delete files or resources on the server
OPTIONS, which lists the requests for files or resources on the server


2015-03-06--ajax Foundation

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.