Home > Web Front-end > JS Tutorial > The core of how Ajax works and its objects

The core of how Ajax works and its objects

php中世界最好的语言
Release: 2018-06-04 11:02:07
Original
1855 people have browsed it

This time I will bring you the core working principle and objects of Ajax. What are the core working principles and objects to pay attention to when using Ajax. The following is a practical case, let’s take a look.

The working principle of ajax:

The working principle of ajax is equivalent to adding an intermediate layer (ajax engine) between the user and the server, making the user operation and server response asynchronous. Not all user requests are submitted to the server. Only when it is determined that new data needs to be read from the server, the ajax engine submits the request to the server on its behalf.

The core of ajax:

It consists of javascript, XMLHT TPRequest, and DOM objects. It makes asynchronous requests to the server through the XMLHTTPRequest object, obtains data from the server, and then uses javascript to operate the DOM to update the page. The most critical step in this is to obtain the request data from the server.

XMLHTTPRequest object:

The biggest feature of AJAX is that it can transmit or read and write data to the server without refreshing the page. This feature mainly benefits from the XMLHTTPRequest object of the XMLHTTP component.

I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to other related articles on the php Chinese website!

Recommended reading:

Three ways to maintain JS code

JS basic usage summary

The above is the detailed content of The core of how Ajax works and its objects. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template