AJAX is a set of web development techniques with different technologies on the client-side to create web applications. Though AJAX is eleven years old by now, it’s only growing in population. Why? Because it can send and retrieve data without changing the behavior of the web page in any way. To do this AJAX uses:
- HTML and CSS to position and style the information that’s presented on a webpage.
- DOM is what allows users to interact with the information they see on the page. It’s also what allows users to view and click on dynamic information to appear like news, entertainment, or the weather that constantly changes.
What happens during an operation?
- An event occurs on the client side.
- The XHTMLHttpRequest is created, and then configured.
- It makes an asynchronous request to the server, and the server responds with an XML document.
- Once the server’s response has been processed the DOM on the user’s side will be updated.
All of this happens so fast that general users won’t be aware so much communication has gone on between servers. This feature has a very complex code that can be difficult to maintain and fix bugs.
When creating an application that uses AJAX, keep in mind that screen readers like JAWS (Job Access With Speech) might not be able to read the page. They may also have trouble showing content that changes dynamically.
What Can AJAX Be Used For?
With AJAX, users can login to a web page without it going to another page. It allows them to log in from the original page, AJAX sends a request to the server that the user has logged in and they can continue as usual.
It’s also behind Google’s autocomplete feature since they were one of the first major companies to take advantage of AJAX. As a user types AJAX searches the database for things that are commonly searched which match the phrase. Any form that requires a user fill out information can use this technology. It’s also better to use this if there are too many input options that would make a drop down menu too bulky.
Any voting or rating features likely use AJAX so it’s quick and easy. Users can make their choice and move on without too much time spent on the poll, online article, online store page, etc.
Frequent users of social media are really seeing AJAX at work. The simplicity of hitting enters (for Facebook users) or sending out a tweet and seeing their profile immediately update is exactly what AJAX does all the time.
Submission forms are usually the trickiest to work with, but they can be made more user friendly by using the autocomplete feature or by validating their email or URL.