AJAX Introduction
AJAX is a technology that can update part of a web page without reloading the entire web page.
What is AJAX?
AJAX = Asynchronous JavaScript and XML.
AJAX is a technology for creating fast, dynamic web pages.
AJAX allows web pages to be updated asynchronously by exchanging a small amount of data with the server in the background. This means that parts of a web page can be updated without reloading the entire page.
Traditional web pages (not using AJAX) must reload the entire page if the content needs to be updated.
There are many examples of applications that use AJAX: Google Maps, Gmail, Youtube and Facebook.
What is an asynchronous request?
The user requests the page, the page is loaded, and the user operates the page and needs to request new data from the server. Since the two requests do not occur synchronously (the latter request is triggered after the user operation) , so we call it asynchronous request
Common ajax applications: automatically load new content after the content is scrolled to the end, automatically go to the server to verify whether it is occupied after entering the user name, pagination without refresh...
Advantages and Disadvantages of ajax
Advantages:
• The user experience is better, the page does not need to be submitted or refreshed, and the content is automatically updated
• Reduce network data traffic. Due to different page layout styles and reloading, ajax only needs to obtain a small amount of data from the server, which is faster.
Disadvantages:
• The page does not jump, causing the user to be unable to click back to access the previous content
• Ajax needs to execute JavaScript to load, causing the search engine to fail
• Abuse of ajax will cause the page to be too bloated. The effect can be achieved by jumping to one page, and all the results are piled into one page
How AJAX works
AJAX is based on Internet standards
AJAX is based on Internet standards and uses the following combination of technologies: Interactive data)
· JavaScript/DOM (display/retrieve information)
· CSS (styling data)
· XML (commonly used format for data transmission)
AJAX applications are browser and platform independent!
Google SuggestAJAX became popular with the release of Google’s search suggestion feature in 2005.
Google Suggest Use AJAX to create a highly dynamic web interface: when you type in Google's search box, JavaScript sends the characters to the server, and the server returns a list of suggestions.
Start using AJAX today
In our PHP tutorial, we will demonstrate how AJAX can affect certain parts of a web page without reloading the entire page. Make an update. We will write the server script in PHP.
If you want to learn more about AJAX, please visit our AJAX tutorial.