DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’» is a community of 967,611 amazing developers

We're a place where coders share, stay up-to-date and grow their careers.

Create account Log in
gyi2521
gyi2521

Posted on

What is Ajax?

What is Ajax?

When the instructor asked "What is Ajax" in my coding boot-camp class, someone immediately answered, "A cleaning solution!". We all laughed but that's how people will answer outside the computer world. So, what is Ajax in the computer world?

AJAX stands for Asynchronous JavaScript and XML. It is a web development technique for creating interactive web applications. AJAX allows web pages to be updated asynchronously by exchanging data with a web server behind the scenes. This means that it is possible to update parts of a web page without reloading the whole page.

A great example would be the Google suggestion list you see in the Google search box. When you start typing something in the Google search box, the list in that drop-down box changes. The content on the page dynamically changes without refreshing the page. How cool!

alt text

So how does Ajax actually works? I got the following diagram and steps from w3schools.

alt text

How AJAX Works

  1. An event occurs in a web page (the page is loaded, a button is clicked)
  2. An HTTP Request object is created by JavaScript
  3. The HTTP Request object sends a request to a web server
  4. The server processes the request
  5. The server sends a response back to the web page
  6. The response is read by JavaScript
  7. Proper action (like page update) is performed by JavaScript

I will explain how to create, add, update, and delete in my next blog, so stay tuned.

Top comments (0)

In defense of the modern web

I expect I'll annoy everyone with this post: the anti-JavaScript crusaders, justly aghast at how much of the stuff we slather onto modern websites; the people arguing the web is a broken platform for interactive applications anyway and we should start over;

React users; the old guard with their artisanal JS and hand authored HTML; and Tom MacWright, someone I've admired from afar since I first became aware of his work on Mapbox many years ago. But I guess that's the price of having opinions.