Home > Web Front-end > JS Tutorial > Detailed explanation of the working principle of AJAX and examples (easy to understand)

Detailed explanation of the working principle of AJAX and examples (easy to understand)

寻∝梦
Release: 2018-09-10 15:00:08
Original
1735 people have browsed it

This article mainly introduces the working principle of ajax. It explains the working principle of ajax with examples. It is easy to understand. Why not hurry up and learn

What is AJAX?

AJAX = Asynchronous JavaScript and XML.

AJAX is a technology for creating fast, dynamic web pages.

By exchanging a small amount of data with the server in the background, AJAX can enable asynchronous updates of web pages. This means that parts of a web page can be updated without reloading the entire page.

For traditional web pages (not using AJAX), if the content needs to be updated, the entire web page must be reloaded.

There are many application cases using AJAX: Sina Weibo, Google Maps, Kaixin.com, etc.

AJAX Example Explanation

The AJAX application above contains a p and a button. The

p section is used to display information from the server. When the button is clicked, it is responsible for calling a function called loadXMLDoc():

<html><body><p id="myp"><h3>Let AJAX change this text</h3></p><button type="button" onclick="loadXMLDoc()">Change Content</button></body></html>
Copy after login

Next, add a

Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template