# AJAX

> AJAX (Asynchronous JavaScript and XML) is a technique that uses browser APIs to send and receive data asynchronously, allowing parts of a page to update without navigating away.

Search engine optimisation · Updated 2026-08-29 · [Marketing glossary](https://www.getlooploop.com/glossary)

**In short** AJAX is a way for a webpage to get new information from a server and show it without making the whole page reload.

## How AJAX works

AJAX relies on the XMLHttpRequest object or the newer fetch API to make HTTP requests in the background. When the request finishes, a callback processes the response—often JSON or HTML—and updates the Document Object Model (DOM) to show new content. Because the request is asynchronous, the browser can continue to run other scripts and keep the page interactive while waiting for the server.

## What to do about AJAX this week

First, audit your site for AJAX‑loaded content that should be indexable, such as product details or article bodies. Second, ensure that the same content is available in the initial HTML or can be rendered by Googlebot via server‑side rendering or dynamic rendering. Third, use the History API (pushState/replaceState) to update the URL when AJAX changes the view, so users can bookmark and share the state. Fourth, test the rendered output with the URL Inspection tool in Google Search Console to confirm Google sees the content. Finally, add a noscript fallback that links to a static version of the page for browsers or crawlers that cannot execute JavaScript.

## How to notice or measure AJAX usage

Open Chrome DevTools, go to the Network tab, and filter by XHR or fetch to see background requests triggered by user actions. Look for request payloads and responses that contain the content you expect to appear on the page. In Google Search Console, use the URL Inspection tool and click “View tested page” to see the rendered DOM; compare it with the initial HTML to spot AJAX‑filled sections. You can also run a site audit with tools like Screaming Frog and enable JavaScript rendering to see which elements appear only after scripts execute.

## Common mistakes

- Blocking JavaScript or AJAX URLs in robots.txt, which prevents Googlebot from seeing the content
- Relying solely on AJAX to load essential information such as prices or product descriptions without a fallback
- Using hashbang (#!) URLs for state changes without providing equivalent pushState URLs
- Updating the DOM but not changing the browser URL, making the state unbookmarkable
- Assuming that AJAX calls are instantly indexed; remember that Google must render the page first

## Limits and confusions

AJAX itself is not a ranking factor; it only affects how content is delivered. It is often confused with Single‑Page Applications (SPAs), but an SPA is a broader architecture that may use AJAX for navigation, whereas AJAX can be used in traditional multi‑page sites. AJAX does not replace server‑side rendering; if the initial HTML lacks critical content, Google may still miss it despite AJAX. Additionally, AJAX cannot be used to set cookies or modify response headers that affect caching unless the server explicitly allows it.

## Worked example

The snippet below shows a fetch request that loads the latest comments for an article and inserts them into the page.

> fetch('/api/comments?articleId=23')\n .then(r => r.json())\n .then(data => {\n const list = document.getElementById('comments');\n list.innerHTML = '';\n data.forEach(c => {\n const li = document.createElement('li');\n li.textContent = c.text;\n list.appendChild(li);\n });\n });

## Progressive enhancement tip

Build the core experience with plain HTML and links, then layer AJAX on top to improve speed and interactivity for browsers that support it.

## Frequently asked questions

### Is AJAX the same as a single-page application?

No, AJAX is a technique for asynchronous data exchange, while a single-page application (SPA) is an architectural pattern that may use AJAX among other methods.

### Should I use AJAX for loading critical SEO content?

Use AJAX for non‑critical UI enhancements, but avoid relying on it for primary SEO content unless you implement server‑side rendering or dynamic rendering.

### How does a search engine crawler handle AJAX‑loaded content?

Modern crawlers can execute JavaScript and follow fetch/XHR requests, but they may miss content that loads only after user interaction or requires complex state.

### Does AJAX still work for SEO in 2024?

Yes, AJAX still works for SEO provided the content is accessible to crawlers either through rendering or pre‑rendered HTML.

### What happens if AJAX content isn't indexed?

If AJAX‑loaded content isn’t indexed, the pages will appear empty in search results, leading to lost traffic and lower rankings for those keywords.

### How long does it take for AJAX‑loaded content to appear in search results?

Indexing of AJAX content can take from a few days to several weeks, depending on crawl budget and how quickly the rendered HTML is discovered.

## Asked out loud

The same term in the words somebody uses speaking to an assistant rather than typing into a box — written from the situation, which is why each one carries the situation it came from.

### I'm on my phone and the product details aren't showing up after I click load more — what's going on?

Usually the details are loaded via an asynchronous request that the crawler may not execute, so check that the content is also available in the initial HTML or via server‑side rendering.

### My client just sent me a report saying the blog posts aren't indexed — could the dynamic loading be the cause?

Yes, if the posts are injected only through background requests, search engines might not see them unless you provide a rendered snapshot.

### I'm reviewing the site audit and see many XHR requests but no content in the search console — how do I fix this?

It depends on whether the XHR responses contain the SEO‑relevant markup; you can add server‑side rendering or use dynamic rendering to serve static HTML to bots.

## Sources

- [Google Search Central – JavaScript SEO](https://developers.google.com/search/docs/crawling-indexing/javascript)

Source: GetLoopLoop Glossary — https://www.getlooploop.com/glossary/ajax. CC BY 4.0: https://creativecommons.org/licenses/by/4.0/

---

Canonical page: https://www.getlooploop.com/glossary/ajax
This is the Markdown copy of that page for AI agents, made from the same content.

Other languages: [uk](https://www.getlooploop.com/uk/glossary/ajax.md) · [es](https://www.getlooploop.com/es/glossary/ajax.md)
