Encyclopedia of Database Systems

Living Edition
| Editors: Ling Liu, M. Tamer Özsu

AJAX

  • Alex WunEmail author
Living reference work entry
DOI: https://doi.org/10.1007/978-1-4899-7993-3_1190-2

Definition

AJAX is an acronym for “Asynchronous JavaScript and XML” and refers to a collection of web development technologies used together to create highly dynamic web applications.

Key Points

AJAX does not refer to a specific technology, but instead refers to a collection of technologies used in conjunction to develop dynamic and interactive web applications. The two main technologies comprising AJAX are the JavaScript scripting language and the W3C open standard XMLHttpRequest object API. While the use of XML and DOM are important for standardized data representation, using neither XML nor DOM is required for an application to be considered AJAX-enabled since the XMLHttpRequest API actually supports any text format.

Using the XMLHttpRequest API, web applications can fetch data asynchronously while registering a callback function to be invoked once the fetched data is available. More concretely, the XMLHttpRequest object issues a standard HTTP POST or GET request to a web server but returns control to the calling application immediately after issuing the request. The calling application is then free to continue execution while the HTTP request is being handled on the server. When the HTTP response is received, the XMLHttpRequest object calls back into the function that was supplied by the calling application so that the response can be processed. The asynchronous callback model used in AJAX applications is analogous to the Operating System technique of using interrupt handlers to avoid blocking on I/O. As such, development using AJAX necessarily requires an understanding of multi-threaded programming.

There are three main benefits to using AJAX in web applications:
  1. 1.

    Performance: Since XMLHttpRequest calls are asynchronous, client-side scripts can continue execution after issuing a request without being blocked by potentially lengthy data transfers. Consequently, web pages can be easily populated with data fetched in small increments in the background.

     
  2. 2.

    Interactivity: By maintaining long-lived data transfer requests, an application can closely approximate real-time event-driven behavior without resorting to periodic polling, which can only be as responsive as the polling frequency.

     
  3. 3.

    Data Composition: Web applications can easily pull data from multiple sources for aggregation and processing on the client-side without any dependence on HTML form elements. Data composition is also facilitated by having data adhere to standard XML and DOM formats.

     

The functionality provided by AJAX allows web applications to appear and behave much more like traditional desktop applications. The main difference is that data consumed by the application resides primarily out on the Internet – one of the concepts behind applications that are labeled as being representative “Web 2.0” applications.

Cross-References

Recommended Reading

  1. 1.
    The document object model: W3C working draft. Available at: http://www.w3.org/DOM/
  2. 2.
    The XMLHttpRequest object: W3C working draft. Available at: http://www.w3.org/TR/XMLHttpRequest/

Copyright information

© Springer Science+Business Media LLC 2016

Authors and Affiliations

  1. 1.University of TorontoTorontoCanada

Section editors and affiliations

  • H. - Arno Jacobsen
    • 1
  1. 1.Dept. of Elec. and Comp.Eng.Univ. of TorontoTorontoCanada