Get the App
SLTechnology News&Howtos  ›  Development  › 

What can ajax do?

Shulou Source: shulou.com Published: 2022-06-02 01:51:03 09月26日 Update

This article mainly explains "what can ajax do". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn what ajax can do.

AJAX is a technology used to create fast dynamic web pages, which can be used to: 1, make local requests to achieve local refresh (update the page without refreshing the page); 2, request data from the server after the page is loaded; 3, receive data from the server after the page is loaded; 4, send data to the server in the background.

The operating environment of this tutorial: windows7 system, javascript1.8.5 version, Dell G3 computer.

What is Ajax?

AJAX = Asynchronous JavaScript and XML.

AJAX is a technology for creating fast dynamic web pages.

AJAX makes web pages update asynchronously by exchanging a small amount of data with the server in the background. This means that some parts of the page can be updated without reloading the entire page.

Traditional web pages (without AJAX) if you need to update the content, you must reload the entire page.

There are many cases of applications using AJAX: Google Maps, Gmail, Youtube, and Facebook.

Used for asynchronous data transfer (HTTP request) between browser and server to achieve local request for local refresh

What does Ajax do? What's the use?

1. Update the web page without refreshing the page (partial refresh)

2. Request data from the server after the page is loaded

3. Receive data from the server after the page is loaded

4. Send data to the server in the background

How to use Ajax?

1. Create a XMLHttpRequest object

2. Use the open method to set the interactive information with the server

3. Set requestHeader () request.setRequestHeader (attribute name, attribute value)

4. Send () sets the data sent and starts to interact with the server

5. Get a response and register the event

Example:

Document

Tags: Servers services data pages web pages parts technology updates properties browsers browsing between content background learning events information dynamic name object Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi MySQL Huawei Linux Shulou Information