Pritam's Blog

Sharing is Caring

By - Pritam Baldota

What is AJAX

What is AJAX ?

  • AJAX is Asynchronous JavaScript And XML.
  • The XmlHttpRequest is an actual object which works behind the scene.
  • Ajax implementation uses JavaScript functions to call methods from a webservice, webpage request in response to get response.
  • Response data is parsed using DOM.
  • Asynchronous data retrieval using XmlHttpRequest

Advantages of AJAX

  • Reduce the traffic travels between the client and the server.
  • Response time is faster so increases performance and speed.
  • You can use JSON (JavaScript Object Notation) which is alternative to XML. JSON is key value pair and works like an array.
  • You can use Firefox browser with an add-on called as Firebug to debug all Ajax calls.
  • Ready Open source JavaScript libraries available for use – JQuery, Prototype, Scriptaculous, etc..
  • AJAX communicates over HTTP Protocol.

Disadvantages of AJAX

  • It can increase design and development time
  • More complex than building classic web application
  • Security is less in AJAX application as all files are downloaded at client side.
  • Search Engine like Google cannot index AJAX pages.
  • JavaScript disabled browsers cannot use the application.
  • Due to security constraints, you can only use it to access information from the host that served the initial page. If you need to display information from another server, it is not possible within the AJAX.