AJAX is an abbreviation of Asynchronous Javascript and XML. This is a technology to access the server without reloading the page. Which means pressure decrease on the data transmitting channels. Due to this, response time is reduced and a web app interacts more like a desktop one.
Despite the fact that the name of the technology contains the letter X (from the word XML), it is not necessary to use XML. By AJAX, we mean any communication with the server without reloading the page, organized using JavaScript.
AJAX uses two methods of working with a web page: changing it without reloading it, and dynamically accessing the server.
First of all, AJAX is useful for forms and buttons associated with elementary actions: add to cart, subscribe, fulfil some data in the contact form, etc. Such actions on the sites are carried out without reloading the page.
Live search is a classic AJAX use case, adopted by modern search engines. A user starts typing a search phrase, and JavaScript offers possible options, getting a list of the most likely additions from the server.
AJAX technology includes the following steps:
An XMLHttpRequest object is created for data exchange; it performs an intermediary function between the server and the browser. There are two types of requests - GET and POST. GET refers to a document on the server, the web resource’s URL is provided as an argument. You can use the JavaScript Escape feature to ensure query continuity. POST is used for large amounts of data and provide better security level. With POST the user’s data is transferred in the cryptographed way, with GET request all information, including the personal name and passwords, is transferred openly, directly in the body of the request code.