Post and get in Ajax

Source: Internet
Author: User

Get: multiple requests return the same result. You can use get to obtain data from the server;

Post: the status on the server needs to be changed.

When using post, you need to set the Content-Type header of the XMLHTTPRequest object, as shown below:

XMLHTTP. setRequestHeader ("Content-Type", "application/X-WWW-form-urlencoded ");

The XMLHTTPRequest object provides two attributes that can be used to access the server response: responsetext provides the response as a string, and responsexml provides the response as an XML object.

Differences Between Dom and JavaScript

Dom is an API for HTML and XML documents. It provides a structured representation of documents and defines how to access the structure of documents through scripts. Javascript is the language used to access and process Dom.

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.