1. It is a technique that allows web pages to load or update their data asynchronously by exchanging it with the web servers.
  2. By asynchronous, we mean to say that different parts of a page can be updated without reloading the entire page.
  3. AJAX can include many formats such as XML, pre-formatted HTML, plain text and JSON.

The following happens in the traditional web model:

  • It is a technique that allows web pages to load or update their data asynchronously by exchanging it with the web servers.
  • By asynchronous, we mean to say that different parts of a page can be updated without reloading the entire page.
  • AJAX can include many formats such as XML, pre-formatted HTML, plain text and JSON.

It is easy to understand the drawbacks of the traditional web model. They are as follows:

  1. The code execution is blocked by the HTTP request.
  2. The complete web page is re-rendered irrespective of the request.

Now let’s understand how the AJAX web model works from the following image:

The following happens in the AJAX web model:

  1. The AJAX method makes an HTTP request to the server.
  2. Since AJAX requests are non-blocking in nature, the code execution continues while the data exchange happens in the background.
  3. The server only returns the relevant response to the AJAX request as a response. This response can be of any format (JSON/XML/Text).
  4. When the AJAX request has been completed, the callback function is initiated for the same.
  5. Instead of reloading the entire web page, only the relevant components are rendered by the callback function.

Now, we can understand how the AJAX web model is a much better approach than the traditional web model. 
The main features of AJAX are as follows:

  • It exchanges data with the server behind the scenes.
  • It updates the web page without reloading the whole page.