Home > Web Front-end > JS Tutorial > body text

Ajax concepts and advantages

亚连
Release: 2018-05-10 10:36:06
Original
1656 people have browsed it

AJAX is mainly used for front-end data interaction and is an essential skill for every website developer. We can first use some basic concepts to roughly understand what AJAX is and what can be written with AJAX?


What is AJAX

In 2005, Jesse James Garrett of Adaptive Path invented He gave the word Ajax a clear definition in his published article "A new approach to web applications". Ajax is a technology used to summarize asynchronous loading of page content. Through page click events, requests are continuously sent to the server, and then the server will return the latest data in real time. This is the function of AJAX.

As a fusion of multiple ideas and technologies, if we break it down, we can see these keywords: Asynchronous JavaScript And XML, asynchronous JavaScript and XML. In the process of using AJAX, we are definitely indispensable in the use of these technologies: using XHTML and CSS standards-based representation technology, using DOM for dynamic display and interaction, using XML and XSLT for data exchange and processing, and using XML HttpRequest for asynchronous data processing. Retrieve and use JavaScript to combine the above techniques. Among them, the core technology of Ajax is XMLHttpRequest, referred to as XHR.

Traditional Web Application PK Ajax

In the past, traditional Web applications involved a large number of page refreshes: as long as the user clicked a link, The request is sent back to the server, and the server returns a new page based on the user's actions. Even if the user sees only a small part of the page that has changed, the entire page must be refreshed and reloaded, including the company logo, navigation, header area, footstep area, etc. This will cause disruption to the user experience.

Use Ajax to update only a small part of the page. Other content, such as logos, navigation, etc., do not need to be reloaded. The user still clicks the link as usual, but this time, only a small area of ​​the already loaded page is updated, rather than having to load the entire page again. This ensures the continuity of user experience.

Advantages

The main advantage of Ajax is that page requests are sent to the server asynchronously.

The server will not respond to the request with the entire page. It will process the request in the background. At the same time, the user can continue to browse and interact with the page. Your scripts can load and create page content on demand without interrupting the user's browsing experience. Using Ajax, web applications can present rich functions, agile interactions, and an experience similar to desktop applications.

Like any new technology, Ajax has its own scope of application. It relies on JavaScript, so there may be browsers that don't support it.

The above is a simple understanding of AJAX knowledge. Let us first know the functions and advantages of AJAX, which will be helpful in subsequent studies.
Related articles:

jQuery ajax dynamic operation form tr td steps detailed explanation

JSONP solution ajax cross-domain issues (with code)

jquery ajax form submission method summary

The above is the detailed content of Ajax concepts and advantages. 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