AJAX (more than a football team from Amsterdam?)
- Winnie Au
- Aug 20, 2015
- 2 min read
AJAX, as we have discovered today, stands for Asynchronous JavaScript and XML. What in the bloody hell?
So since then, I've gone around like a mad woman trying to figure this out, and from my understanding, AJAX is a method of building interactive applications for the web that processes user requests immediately. It is not a single technology but a group of technologies that work together to make this possible.
Some applications that you are probably familiar with that use AJAX are Google Maps and Twitter. As you can probably tell, those two applications are constantly making new information available to the user. Now how is this possible without requiring long loading times?
The A in AJAX is "Asynchronous". In this context, Asynchronous means that the client can request new pieces of information from the server at any time. They do not have to wait for a whole new page to load.
This is because there is no need to reload a new page every time the user requests more information. Instead, when the browser requests a page from a website, it is acting as a client and the client requests information from the server. The server then delivers the data back to the client, usually in the form of JSON or XML (these days more likely JSON), but instead of necessarily sending back a whole new page, AJAX returns that data to your JavaScript.
How does this happen? Let's take a look at the second letter in AJAX.
JavaScript is like your dream wedding planner. Why? Because JavaScript manages the events that trigger a new request, makes requests for new data to the server and takes care of updating only the part of the document that needs to change. And JavaScript does it like a PRO. How? With a lot of help from a set of programming methods called an API and uses an XHR (XML HTTP Request).
We now move onto the X portion of AJAX, XML, which is Extensible Markup Language. XML is a specification for storing information and describing the structure of that information. It is similar to HTML, but XML has no prewritten tags of it's own. It allows users to create whichever tags they need. However, nowadays we use more JSON rather than XML so it's really somewhat of a misnomer, but AJAX sounds much better than AJAJ, so I imagine we'll stick with calling it AJAX for now.
I've included a diagram that I found to be quite helpful which I acquired online. If you're as visual of a learner as I am, this should be able to illustrate what I mean, and give you a sense of what using AJAX is like as opposed to not using it.

Oh, and this is also AJAX, just not the kind we programmers need to know about:

Comments