What is AJAX?
What is AJAX used for, and what companies use it?
- Login forms — digg.com
- Auto-complete with the search bar — google.com
- Voting and rating content — reddit.com
- Updating user content — twitter.com
Why do developers use AJAX?
AJAX provides more efficient and smoother running applications, which gives users better interactive experiences.
How does AJAX work?
AJAX, sends and retrieves data from a server asynchronously. This enables the web application to continue running and dynamically display. It allows the user to interact with the information presented on the page, avoiding full page reloads.
The image below shows the process the execution of AJAX.
- A user interaction in the browser triggers the event, such as a button click
- The AJAX call fires. This creates and AJAX request, browsers use the XMLHttpRequest object. When the server responds to the browser’s request, the same XMLHttpRequest object will process the result.
4. After the data is processed, the script sends the data back to the original client-side page that made the request via XML