Skip to main content

What is AJAX all about? What is the use of AJAX ?

Brief Introduction to AJAX



Many of you may be wondering what is AJAX? and Why one should learn it? So let's have a look at how you can use AJAX with JavaScript, for developing a dynamic web application?

Before discussing about AJAX let's have a look at how browser's get information to display a page. When a browser requests a page from a website , then the browser in your machine is acting as a client. The website is being delivered through a machine that is serving up the information, therefore we call that a server.

When you ask for a page, the client makes a request to a server and the server returns a page. Sometimes when you are looking at a page you may want to ask for some additional information from the server. Say for ex: - That your page has some thumbnails for photo albums and perhaps the album has more thumbnails than you can see in the current view.

Without AJAX, if you want to see more thumbnails, you would have to make a request back to a server, who will send you a whole new page with additional thumbnails. That means the server ends up sending a lot of information that you don't ever need all over again.

With AJAX a server does not have to send you a whole page, it just sends you the pieces you need . In this case, it sends thumbnails, so how does that works? AJAX is not a single technology but a group of technology that works together to make that happen.

Technically, AJAX stands for Asynchronous JavaScript and XML. Lets us break it down piece by piece.

"Asynchronous"  means a client can request a new pieces of information from the server at anytime. It does not have to wait for a page to reload. A request can be triggered by an event like a click on a button or bring over an image or whatever. The "J" in AJAX stands for JavaScript. JavaScript is where all this magic takes place. It handles the events that triggers new request , makes a request for a data to a server and takes care of updating only the part of the document, that needs to change.
JavaScript talks to a server through a set of methods called as API and uses what is called an XHR or XML HTTP request, this is where the X in AJAX comes from. The XHR API lets the browser to send and request data from a server. This can be a bit confusing because a lot of people thinks of XML as a language that used data which allow like HTML. Sometimes people assume that the X in AJAX means the data from an AJAX request has to be an XML. But the data they get transferred to and from the server can be in any format and it is usually either a text file or HTML or a JavaScript object like JSON.




So AJAX is really just a fancy term for technology let's you built pages that updates without requiring a page reload. JavaScript is the most of the heavy listing with AJAX and it is uses the XHR API to handle the communication between the client and server.

I Hope this helps you in knowing about AJAX to some extent that resolves your doubts.

Comments

Popular posts from this blog

What Relational Database Management System is all About ? What is RDBMS?

In this tutorial, we will discuss Relational Database Management Systems .  Let's first discuss What do databases do ? Databases have an ability to store a large amount of data. So when we search for any information on the internet then it finds all the URL's that meet the criteria. So far if you have been looking for a particular data or subject and type that in a web browser and click search then that's actually talking to a database. When you use Twitter, all messages are stored and indexed by #tags and every time any tweet is sent it is stored in a database allows them to search them for information, with a particular information, with particular #tags. We use PhotoBucket for uploading images on the internet and they have been linked to the user accounts. Other people can access those images as well and also other programs like Facebook, Messenger etc. Also, a lot of Google products are products of the database. Databases are required to store a ...

Top 10 Website Hosting Companies in 2019

Top 10 Website Hosting Companies in 2019. There is a number of websites of individuals or businesses. This website can be accessed from any part of the world once they are entered or kept on the web. Now web hosters are the company or firm who uses the technology, tools and various factors necessary to keep any particular site on the web. 1. High performance. 2. Cost. 3. Maintainance. 4. Effectiveness. 5. Server Location. 6. Customer Support 7. Security. 1)  HostGator HostGator is a global provider of web hosting and related services. Founded in a dorm room at Florida Atlantic University by Brent Oxley, HostGator has grown into a leading provider of Shared, Reseller, VPS, and Dedicated web hosting. HostGator is headquartered in Houston and Austin, Texas, with several international offices throughout the globe. for more details:  https://www.hostgator.in 2)  Hostripples Hostripples is among the first companies in India to offer fully automate...