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!