Simple Explanation of AJAX

Kevin Su
Kevin Su
Jul 21, 2017 · 2 min read

Lets start with some of the basic components involved.

We have a web page/client (where we want to see our information)

Then we have a server (where the information is located)

Lets make up a scenario. Let’s say we want to get the data off the server we send a message to the server asking for our data (HTTP Request), then we get a response from the server. Then we reload the page, and we will get our data!

If it takes some time to get the information off the server, the user would have to wait for it to load. During this time, the user wouldn’t be able to do anything else on the page until the data is reloaded. This is what we call a synchronous request. This isn’t very convenient for the user.

Here comes AJAX to the rescue.

AJAX stands for Asynchronous Javascript and XML. Essentially this is the opposite of what we had before. Now our client can ask for data from the server (AJAX Request) in the background while still having access to all the other elements on the web page.

This constant requesting of information allows us to dynamically load data without reloading the whole page. That is the asynchronous part. The Javascript part is how we notify the server that the user is requesting new data, and also that we need to update a specific portion of the web app only. The ‘X’ portion of AJAX stands for the AJAX Request object which is also known as the XML.

Just as a final note, the data being sent doesn’t necessarily have to be XML. It can also be HTML, Plain Text, or JSON.

Thats it!

)

Written by

Kevin Su

Software Engineer | Graphic Designer …. I make things.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade