Common methods in XMLHttpRequest

Source: Internet
Author: User

A.) abort () Stop the current request
B.) getAllResponseHeaders () returns all response headers for the HTTP request as key-value pairs
C.) Open ("Method", "url", async) make a call to the server. The method parameter can be for GET, POST, url can be relative or absolute path, third parameter: True asynchronous/false Synchronous, default is True
D.) Send request to the server for post only
E.) setRequestHeader ("header", "value") sets the specified header to the provided value and must first call open () before setting any header
F.) onreadystatechange each change in the body triggers the event handler, which usually invokes a JS function comment: The onreadystatechange event is triggered 5 times (0-4), corresponding to each change in the readystate
G.) ReadyState Status value: 0 = uninitialized, 1 = loading, 2 = already loaded, 3 = in interaction; 4 = complete.
H.) The response of the ResponseText server, indicating a string
I.) The response of the Responsexml server, expressed as XML. This object can be parsed as a DOM object
J.) Status server state code, 500 (Error inside server), 404 (page does not exist), 200 (communication access succeeded)
K.) statustext response text for HTTP status code

Common methods in XMLHttpRequest

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.