AJAX partial refresh and jsajax partial refresh

Source: Internet
Author: User

AJAX partial refresh and jsajax partial refresh

AJAX is "Asynchronous Javascript And XML" (Asynchronous JavaScript And XML), which is a Web page development technology used to create interactive web applications.

AJAX = Asynchronous JavaScript and XML (subset of standard General Markup Language ).

AJAX is a technology used to create fast dynamic web pages.

The following describes how to implement the AJAX partial refresh function in JS. The specific content is as follows:

By performing a small amount of data exchange with the server in the background, AJAX can implement asynchronous updates on webpages. This means that you can update a part of a webpage without reloading the entire webpage.

// Create the XMLHttpRequest object var xhr = new XMLHttpRequest (); // request line xhr. open ('post', '03-ajaxPost. php '); // Request Header xhr. setRequestHeader ('content-type', 'application/x-www-form-urlencoded'); // Request body post send sets data xhr. send ('name = '+ txt); // listen to the response of the server xhr. onreadystatechange = function () {if (xhr. readyState = 4 & xhr. status = 200) {// This indicates that var r = xhr when the server response is successfully received. responseText; document. querySelector ('. info '). innerHTML = r ;}}

The above section describes how to implement the AJAX partial refresh function in pure JS. I hope it will be helpful to you. If you have any questions, please leave a message and I will reply to you in a timely manner. Thank you very much for your support for the help House website!

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.