AJAX..What is it good for?

Asynchronous Javascript And XML, also know as AJAX, uses XMLHttpRequest to communicate with the server. It uses Javascript functions to call methods and uses the DOM to parse the response. The thing that developers find most appealing about AJAX requests is its asynchronous nature. It lets you update a webpage without reloading it, and also lets you send and receive data from the server in the background.

Advantages of AJAX

  • Faster response which results in an increase in performance and speed.
  • Provides a more seamless user experience.
  • It can handle various datatypes like JSON, XML, HTML, etc.
  • Allows us to have a more compact application, avoiding the need for several pages.
  • AJAX is widely used companies like Google, Quora etc.

Disadvantages of AJAX

  • It can increase development time as its not easy to implement.
  • Security is a concern, as files are downloaded client-side.
  • Indexing problems which might effect SEO and navigation. Since AJAX content is produced dynamically in the browser, they are not visible to crawlers. Though there is an implementation of a ‘parallel universe’ which you can use to overcome this hurdle.
  • AJAX applications can’t work on Javascript disabled browsers.

Example of an AJAX call.