Ajax

AJAX - What is AJAX?

AJAX - What is AJAX?

AJAX can be defined as a tool or technique that uses a group of technologies such as HTML, XML, CSS, and JavaScript to create dynamic and better web pages. The set of technologies within the AJAX system consists of-

  • HTML/XHTML works as the main language for presentation and CSS take care of various aspects of the presentation.
  • XLM for data interchange. JSON is also used by developers nowadays. 
  • XSLT for data manipulation.
  • XMLHttpRequest object to interact asynchronously with servers.
  • DOM (Document Object Model) to dynamically update and display the content.
  • JavaScript to bring all these technologies to work harmoniously.

Unlike conventional web technologies that used synchronous requests, AJAX uses asynchronous requests to allow web pages to update dynamically without reloading the entire web page. Earlier, users had to wait till the updated data is uploaded on the web page and then it was refreshed to display the results. The load on the server and wait times were huge. AJAX has streamlined the experience without experiencing any delay in loading information on the web pages. Users can access content swiftly and with added ease. The data interchange between the server and presentation work independently without interfering with each other. 

Java Script is a popular coding language that helps in managing dynamic web content. XML stands for eXtensible Markup Language and much like HTML, it stores and carries data. Both these technologies communicate asynchronously to make web applications more interactive.    

Here’s how AJAX works

  • Let us say an event occurs such as a button is clicked on the website.
  • JavScript creates an XMLHttpRequest object.
  • The browser sends the XMLHttpRequest object to the web server.
  • The server processes the request.
  • The server creates a response and sends it back to the web browser.
  • The returned response is processed in the browser using JavaScript.
  • The relevant action is performed by JavaScript such as page content update. There is no need for reloading.