Skip to main content
History

History

The ideas behind AJAX predate the name. Browsers have supported background requests in some form since the late 1990s, but the technique became mainstream when large web applications proved it could feel like desktop software.

Early background requests

Microsoft introduced the XMLHTTP ActiveX object with Internet Explorer 5 in 1999. It allowed a page to request data without navigating. Other browsers later implemented the standard XMLHttpRequest object, and the same pattern became available across platforms.

The name AJAX

In 2005, Jesse James Garrett published an article describing the technique as AJAX. The term caught on because it named a design approach, not just an API. Around the same time, Gmail and Google Maps demonstrated that a web page could update continuously and respond to interaction without full reloads.

From XML to JSON

Early examples exchanged XML. Developers soon preferred JSON because it maps naturally to JavaScript objects and produces smaller payloads. XMLHttpRequest still supports both through responseText and responseXML, but most APIs now return JSON.

The Fetch API

As promises became standard, browsers added fetch(), a promise-based replacement for most XMLHttpRequest usage. Fetch offers a cleaner API, integrates with service workers, and exposes response bodies as streams. It does not reject on HTTP error statuses, which is a common source of bugs for newcomers.

const response = await fetch('/api/posts');
if (!response.ok) {
  throw new Error(`Request failed: ${response.status}`);
}
const posts = await response.json();

Streams and incremental rendering

The Streams API lets JavaScript process a response while it is still arriving. That enables progress indicators, large file handling, server-sent data, and transformations without buffering the entire payload in memory. Support is broad in modern browsers but still uneven for advanced features.

Why the history matters

Understanding the evolution explains why so many styles coexist. Legacy code uses XMLHttpRequest; modern code uses Fetch and streams; server-rendered applications still use full-page navigation. None of these approaches is obsolete, and choosing one is an engineering decision rather than a fashion statement.