This article was automatically translated from the original Turkish version.
AJAX (Asynchronous JavaScript and XML) is a web programming approach that enables asynchronous data exchange between the client and server through JavaScript code running on the client side. With this method, only the necessary parts of a web page are updated without reloading the entire page. AJAX is not a single technology but a suite of technologies that integrate XHTML/CSS for the presentation layer, the Document Object Model (DOM) for dynamic interaction management, data formats such as XML or JSON for data transmission, the XMLHttpRequest object for asynchronous communication, and JavaScript to coordinate all these components.
The term AJAX was first used in 2005 by Jesse James Garrett. However, the underlying techniques had been applied in limited ways in web-based applications since the late 1990s. The XMLHttpRequest object initially appeared in Microsoft’s Internet Explorer browser as an ActiveX object and was later adopted as a built-in feature by other browsers.
In the mid-2000s, applications such as Google Suggest and Google Maps brought AJAX to widespread attention; these projects enabled interactions such as fetching data without page reloads, auto-completion, and drag-and-drop functionality on maps.
1. Presentation Layer: Content defined using XHTML or HTML, styles defined using CSS.
2. Dynamic Interaction: Dynamic modification of page elements via the DOM.
3. Data Formats: XML, JSON, plain text, or other structured data formats.
4. Asynchronous Communication: XMLHttpRequest object or, in modern applications, the fetch() API.
5. Control Layer: Management of client-side logic and data flow between components using JavaScript.
In the traditional web application model, each user interaction sends a full-page request to the server, and the response results in the entire page being reloaded. In the AJAX model, the browser loads an “AJAX engine” during the initial page load. User interactions are first handled by this engine; when data is needed, a request is sent asynchronously to the server via XMLHttpRequest. The data returned from the server is processed only in the relevant section of the page, allowing the user to continue interacting with the rest of the page during this process.
This architecture eliminates the “start-wait-start” cycle that interrupts user interaction and forms the foundation of single-page applications (SPA).
AJAX is commonly used in conjunction with SOAP or REST-based web services. Web services operate over the HTTP protocol using XML or JSON data formats and are platform and technology independent.
SOAP: XML-based data transmission with service definitions via WSDL.
REST: HTTP methods (GET, POST, PUT, DELETE) and typically JSON data format.
Through these services, the AJAX client abstracts database access and makes it available for use by different client applications.
History and Emergence
Technical Components
Working Principle
Integration with Web Services
Application Areas
Advantages
Limits and Challenges
Prominent Applications