Without AJAX each time the user clicks a link, a button, or submits a form the browser needs to fetch a new page from the server. This restriction slows the user's progress as each click requires them to download a full page.
By enabling applications to send and receive data via AJAX we can record user input and manipulate the page in real time. This makes the web application behave more like the desktop applications users are already familiar with.
How is AJAX used?
AJAX is most useful when a process requires multiple steps to complete. Let's say you needed to search a database for users, select a user, and edit that user's last name.
Without AJAX you'd need to create these separate steps:
- Search for users
- Display search results
- Display edit user form
- Acknowledge changes
To make more changes you'd need to repeat the entire process.
Using AJAX we could achieve better results by creating fewer but more dynamic pages. Searching for users and displaying results would be combined into a single step. By combining multiple steps we can speed up the process of data entry.
If you would like to investigate further here are a number of good resources for more information.