PROGRAMMING BASICS: Understanding AJAX (One Way Sites Get Data)

in programming •  7 years ago  (edited)

PROGRAMMING BASICS: Intro Thoughts

I wanted to write a few articles about programming basics that I think are beneficial for everyone to understand. Technology is moving at a fast pace and I feel that understanding a few principle concepts is becoming almost as important as being able to read. I think so many people either live in fear due to lack of knowledge or they float in a utopia of "nothing can happen to me!" Both of these are dangerous and I wanted to see if I could help. Hopefully I will do a decent job explaining these concepts but time will tell.

ROAD BLOCKS

1) Crazy Jargon

A few of the road blocks that I see in people understanding these concepts is the jargon that is used. It can be overwhelming. The thing is that a lot of the terms are just replacing a simple concept, but we hear the term and have no idea and assume that it is WAY over our head. It doesn't help that the learning curve is step but that doesn't change that it is much easier to mention things in one word then to explain a concept over and over. You just need to know that everyone starts out there.

2) New Way of Thinking

Another road block I wanted to bring up is how we process information. It takes a bit to think about how computers process information versus how you do. You assume a lot. We don't realize how much we assume with information. This 📹 video is a great example of this concept.


program.png


Where to start? That is a tough one. There are SO many things we could start with to understand what is going on with connected devices, programming and the internet.
So... I just decided to pick one that I think is beneficial to understand:

AJAX

Let's start with AJAX.

AJAX = Asynchronous JavaScript And XML.

AJAX is not a programming language.

AJAX just uses a combination of:

A browser built-in XMLHttpRequest object (to request data from a web server)
JavaScript and HTML DOM (to display or use the data)

So that throws us some jargon and isn't completely easy to understand so let's break it down. First off AJAX is not a programming language or something you can build or create really. It is more of an event that happens. It is like driving. 🚘 Driving is something you do. You need a person. You need a car. Those things have other requirements too, but driving isn't a physical thing.

This is similar to AJAX (although not the best comparison but it will do 😀). You need javascript and HTML to render data but you don't build AJAX. When you have a webpage sometimes you need data that lives somewhere else. You don't have it. However, other servers allow you to come and get it. So you can "call" out to that server and request the data you need to show on your page. This works but there needs to be a way to read the data. We have to agree on some format or it just will not work. The great news is that we have. (Don't get too fixed on the jargon here.) We needed to name them something so AJAX is what became that name.

The first way that was agreed on was XML. It is still used a lot but it can be difficult to read through and just repetitive. So we came up with another way. It is called JSON. This is easier to read and works better. So the X in AJAX stands for XML. That is the way we would send the data but over time we changed to JSON. The problem is that there is no value in having two names for the same concept (remember AJAX is a concept like driving) so we just kept it. Even though we changed to the data being in a style called JSON, we kept the same name.

It can be confusing. I get it. 😀

The purpose of AJAX is to allow your site to call out to other servers and receive data in a format that is consistent. Every site that displays data that is not native to the server that is sending it is using AJAX. For instance, if a site displays Amazon data then it is making AJAX calls to Amazon. If You use my chrome extension for Steemit then it is making an AJAX call to get data to display.

  • We needed to be able to show data from other places.
  • We needed a format to allow everyone to be able to do this consistently.
  • Lastly, we needed a name to call it and AJAX stuck.

[Hopefully this is helpful and not too confusing. I definitely encourage you to explore AJAX and other concepts with web development. 🎓]

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Follow me, and i will follow you too

nice post
i will follow you, i hope you follow me too :)

Ahh... The wonderful and productive "Follow ME!" comments.

Thanks, guys! 😃

Gotta love them. :D