Skip to the content
Start free

AJAX

AJAX (Asynchronous JavaScript and XML) is a way of building web pages where JavaScript fetches new data from the server in the background and updates part of the page, without reloading the whole page. Despite the name, the data today is usually JSON, not XML. AJAX makes pages feel quick, but content loaded this way can be missed by search engines and AI crawlers.

What is AJAX? #

MDN’s AJAX glossary entry describes it as a technique where a web app makes asynchronous HTTP requests and uses the new content to update only the parts of the page that need it. You see it every day:

  • Search boxes that suggest words as you type.
  • “Load more” buttons and endless scroll on product lists.
  • Filters that change the products shown without a new page.
  • Baskets that update the total when you add an item.
  • Reviews or stock levels that appear a moment after the page.

MDN says AJAX first used the XMLHttpRequest interface, and that the newer fetch() API suits modern web apps better. The technique is now so common that MDN notes the word “Ajax” itself is rarely used.

How does it work? #

  1. The browser loads the first HTML page.
  2. A script runs and sends a request in the background, for example fetch('/api/reviews?product=42').
  3. The server replies with data, often JSON.
  4. The script writes that data into the DOM, the live structure of the page.
  5. The person sees new content. The address bar may not change at all.

Step 5 is where search problems start. If the address does not change, there is no separate page to index. If the content only exists after a script runs, a bot that does not run scripts never sees it.

Google can run JavaScript, but it does it in stages. Google’s JavaScript SEO basics describes three phases: crawling, rendering and indexing. Pages with a 200 status are queued for rendering, and a page may wait there for a few seconds or longer. Content that arrives by AJAX is only seen after rendering.

The same guide sets out the rules that matter most for AJAX sites:

  • Real links. Google finds links only when they are <a> elements with an href. A “load more” made from a script-only button gives Google nothing to follow. See internal linking.
  • No fragments for content. Google says not to use # fragments to load different page content.
  • Use the History API. For apps that change views without reloading, Google recommends the History API for routing.
  • Handle errors. In apps that route in the browser, a missing item can return 200 and become a soft 404. Google suggests a redirect to a server-side 404 page or a noindex tag.

MDN’s page on history.pushState() explains the History API part: it adds an entry to the browser’s history and changes the address shown, but the browser does not load that address. So each AJAX view can have its own real URL that also works when opened fresh.

What was the AJAX crawling scheme? #

In 2009 Google proposed a way to make AJAX pages crawlable using #! addresses and _escaped_fragment_ copies served to its crawler. On 14 October 2015 Google deprecated that scheme. It said its systems could now render pages much like a modern browser, as long as Googlebot was not blocked from the JavaScript and CSS files. It advised progressive enhancement and pushState() instead, and asked new sites not to add _escaped_fragment_ addresses. If you still see #! addresses on a site, they are a sign of very old build choices.

Why does it matter for AI answers? #

Many bots are simpler than Googlebot. Google itself warns that some bots cannot run scripts, and still favours rendering on the server or in advance. So assume some AI crawlers and live fetchers only read the HTML they are sent. If your price, stock, reviews or delivery dates are loaded by AJAX, an AI answer may get them wrong or leave you out. Put the facts people ask about into the first HTML response, then use AJAX for extras.

Common mistakes #

  • Key facts loaded late. Product name, price and stock drawn by script after load.
  • Endless scroll with no pages. Products beyond the first screen have no address. Pair it with real pagination links.
  • Filters with no rules. Each filter makes a new address with parameters, creating thousands of near-copies. See faceted navigation and canonical tags.
  • Blocked API or script files. If robots.txt blocks the scripts or the data address, Google cannot render the content.
  • Layout jumps. Content that arrives late and pushes the page down hurts cumulative layout shift.
  • Every error returns 200. A broken AJAX view looks like a valid page to bots.

A worked example #

A small UK shop lists 240 kettles. The category page shows 24, then loads more by AJAX as you scroll. Reviews load a second after each product page.

Item As built What bots see Fix
Products 25 to 240 Loaded on scroll, no links Only the first 24 Add ?page=2 to ?page=10 as real <a href> links
Scroll position Address never changes One page Use pushState() to set ?page=n as pages load
Reviews Fetched by script Googlebot after rendering; many AI bots never Print the rating and count in the HTML
Price and stock In the HTML Seen by all Keep as it is

How to check it #

  1. Turn JavaScript off in your browser and reload the page. What is left is roughly what simple bots see.
  2. Open URL Inspection in Google Search Console and view the rendered HTML Google stored.
  3. To see if AI tools can open the page at all, try our AI Readiness Checker.
  4. Use the HTTP Header Checker to confirm each view returns the right status code, and the Broken Link Checker to find dead links.
  5. Raw versus rendered side by side is the job of our JavaScript SEO Checker. In URSY Pro, the JavaScript rendering check does it across a site.
  6. Tidy API replies with our JSON formatter and split addresses with the URL parser.

Questions #

Is AJAX bad for SEO? #

No. It is bad only when it hides content or links. Keep core facts in the HTML and give each view a real address.

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

No. A single-page app uses AJAX heavily, but any normal page can use a little AJAX too.

Does lazy loading count as AJAX? #

Not always. Image lazy loading delays files; AJAX fetches data. Google calls lazy loading images a good strategy.

Should I still use XML? #

Use whatever your server sends best. Most sites use JSON today.

Sources #

Updated 24 November 2026 by URSY.

Cite this page: AJAX. URSY. Updated 24 November 2026. https://ursy.com/wiki/ajax/ · Section links

Tools for this

All 871 wiki entries, A to Z →