What is AJAX?

512 views
AJAX

AJAX stands for Asynchronous JavaScript And XML. It is not a programming language.

AJAX is a combination of:

  • XMLHttpRequest object which is built-in browser and is used to request data from a server.
  • JavaScript and HTML DOM to display the data.

How does AJAX work?

AJAX allows web pages to be updated asynchronously by sending and receiving the data in the background. It allows updating parts of a web page, without having to reload the whole page.
By not sending all form data to the server, network utilization is minimized and quicker operations occur on servers. The data being sent to and from the server is minimal so servers do not have to process other data that is not required in that particular operation. By sending only the necessary data, limited processing happens on the server-side. This makes applications to be more responsive, faster and more user-friendly.

  1. An event occurs in a web page
  2. XMLHttpRequest object is created by the JavaScript
  3. The XMLHttpRequest object sends a request to a web server
  4. The server recives and processes the request
  5. The server sends the response back to the web page after processing the request
  6. The response is read by JavaScript bulit-in the web browser
  7. Proper action is performed by JavaScript

Conventional web applications exchange information with the server using synchronous requests. It means the user has to fill in a form, submit the form, and get directed to a new page after the request is processed from the server.

With AJAX after the user has hit the submit button on the form, JavaScript will make a request to the server, receives the results from the server, interpret the results, and update the web-page in the background, the user doesn’t even know that page has been updated. XML is generally used as the format for receiving the data from the server. It is an open-source program, anyone can modify the code to improve the functionality of their applications.

Popular uses in web-development

  • Data validation in the froms, user logins verfication from the server
  • change the values in a drop down list-box based on inputs by the users. E.g. When a user selects a country, the list of states box will repopulate automatically
  • Autocomplete text boxes
  • To submit reviews and ratings
  • Instatnt messaging systems
  • in lightboxes, lightboxes are pop-ups withinn a web-page. they increase the interactivity of the sites, donot annoy users with unnecessary pop-up screeen and are not blocked by the pop-up blockers.

We at NEXT BIG TECHNOLOGY, use AJAX along with Javascript and XML in web development, mobile application development to make them more interactive, fast, efficient, light-weight and dynamic in nature.

Do NOT follow this link or you will be banned from the site!