Does AI render JavaScript
EN

Does AI render JavaScript

Last verified: June 22, 2026
6min read
Opinion
PageSpeed 100/100

#What the test actually proved

In June 2026 someone finally ran the clean experiment instead of guessing. The result: six of the seven leading Western AI assistants do not run your JavaScript when they fetch a page to ground an answer. They read the raw HTML and nothing else. If the facts a customer needs, your price, your spec, your service description, appear only after client-side JavaScript executes, those assistants cannot see them. To the AI answer layer, that content does not exist.

This is not a new idea for search engineers, but it had been argument rather than evidence. Now it has been tested directly, and the evidence is uncomfortable for the large class of sites built as JavaScript applications that assemble their content in the browser.

#The experiment, in one paragraph

The test, run by Andre Alpar and published through CitationOne, was simple and hard to fool. The page served a decoy reference number in its raw HTML. The real number was substituted only by external JavaScript, fetched from a second endpoint. Each assistant was given a unique, unguessable URL, and the server logged three separate events: the page fetch, the JavaScript file fetch, and the call to the number endpoint. The logic is airtight. Return the real number and you executed the script. Return the decoy and you read only the HTML.

#Who read only the HTML

These assistants returned the decoy, meaning they grounded on raw HTML and never ran the script:

  • ChatGPT
  • Claude
  • Gemini
  • Perplexity
  • Meta AI
  • Microsoft Copilot

Grok executed the JavaScript on one node but still returned the decoy, so even where the script ran, the rendered value did not make it into the answer.

#Who did render JavaScript

Five assistants returned the real number, proving they executed the script:

  • DeepSeek, ERNIE, Qwen and Kimi, all from China
  • Mistral, from Europe

So JavaScript rendering by AI is genuinely happening. It is just that, for the major Western assistants most European businesses actually care about, it is the exception. The split is striking enough to plan around: build for the assistants your customers use, and today those read HTML.

#”But Google renders JavaScript”

This is the objection that derails the conversation, so deal with it head on. Yes, Googlebot renders JavaScript for the classic search index. That is a separate pipeline from AI-answer grounding, and the test is about the second one. A page can rank perfectly well in classic Google search on content that only exists after JavaScript runs, and still be invisible when ChatGPT or Perplexity fetches it to compose an answer. Treating “Google renders JS” as proof that “AI renders JS” is the mistake. The two systems behave differently, and the gap is exactly where AI visibility quietly leaks away.

#What this breaks in practice

The risk is concentrated in a recognisable set of patterns:

  • Single-page applications that ship an almost-empty HTML shell and assemble the page in the browser.
  • Prices, stock status, or specifications injected by JavaScript from an API after load.
  • Content hidden behind client-side tabs, accordions, or “load more” that only fetches on interaction.
  • Product or service descriptions rendered by a client framework with no server-side fallback.
  • Reviews, ratings, and FAQ widgets embedded as third-party JavaScript.

If any of those carry the facts you want an AI to repeat, you are betting your AI visibility on rendering behaviour that six of seven Western assistants just failed.

#The boring fix, now confirmed for AI

The remedy is the rule classic SEO has repeated for a decade: put the load-bearing facts in server-rendered HTML. Static site generation and server-side rendering both satisfy it. The framework does not matter; where the HTML is assembled does. Render the content on the server, ship it in the initial response, and let JavaScript enhance rather than supply it.

You can verify your own site in a minute. Fetch a page without a browser and read what comes back:

curl -s https://your-site.example/your-page/ | less

If the headings, body copy, prices, specs, and the Schema.org JSON-LD are all in that raw response, AI assistants can read them. If the page is a thin shell that fills in after the script runs, that is your problem, and now you can see it.

#How our own stack handles this

We are not neutral here, because we made this bet on purpose. wppoland.com runs on Astro, which renders pages to static HTML at build time and serves them from the edge. Everything that matters is in the raw response: the body text, every heading, the FAQ, and the Schema.org JSON-LD. We checked it the same way the test did, by reading the raw HTML rather than the rendered page, and the content is all there before a single line of our JavaScript runs. JavaScript on our pages is enhancement, never the source of the content.

That is the same conclusion we reached the long way around in serving content to AI agents: clean, server-rendered, semantic HTML plus Schema is the one signal both classic crawlers and AI systems actually consume. This test is the cleanest evidence yet for that position. It is also why a GEO and LLMO programme has to start with how the page is rendered, not with clever metadata, because metadata an assistant never executes is metadata it never reads.

#Glossary

For readers who run a business rather than a build pipeline:

  • Server-side rendering / static generation - the page’s HTML is assembled on the server (or at build time) and arrives complete in the first response.
  • Client-side rendering - the server sends a near-empty shell and the browser’s JavaScript builds the page afterwards.
  • Grounding - when an AI assistant fetches real pages to base an answer on facts rather than memory.
  • Hydration - JavaScript attaching interactivity to already-rendered HTML; safe, because the content was there first.

#The honest takeaway

JavaScript rendering by AI assistants will probably improve over time, and the Chinese assistants plus Mistral show it is technically routine. But you do not get to publish for the assistants you wish existed. You publish for the ones your customers use, and in June 2026 the biggest Western assistants read raw HTML and stop there. The safe, boring, decade-old answer turns out to be the correct one for AI too: serve your facts in HTML the server already rendered, and treat anything that only appears after JavaScript as content the AI will not see.

Next step

Turn the article into an actual implementation

This block strengthens internal linking and gives readers the most relevant next move instead of leaving them at a dead end.

Want this implemented on your site?

If visibility in Google and AI systems matters, I can build the content architecture, FAQ, schema, and internal linking needed for SEO, GEO, and AEO.

Related cluster

Explore other WordPress services and knowledge base

Strengthen your business with professional technical support in key areas of the WordPress ecosystem.

Do AI assistants like ChatGPT and Claude run my website's JavaScript? #
In a June 2026 live test, no. ChatGPT, Claude, Gemini, Perplexity, Meta AI and Microsoft Copilot all returned a decoy value that lived in raw HTML, while the real value, injected by external JavaScript, was ignored. They grounded on the raw HTML only. If your important content appears only after client-side JavaScript runs, those assistants do not see it.
Which AI assistants did render JavaScript? #
In the same test, five rendered the script, the Chinese assistants DeepSeek, ERNIE, Qwen and Kimi, plus Mistral from Europe. Grok executed the script on one node but still returned the decoy. So JavaScript rendering by AI is real but, for the major Western assistants most businesses care about, currently the exception rather than the rule.
But doesn't Google render JavaScript? #
Googlebot renders JavaScript for the classic search index, yes. AI-answer grounding is a different pipeline, and the test shows the Western assistants did not run the script when fetching the page for an answer. So a page that ranks in classic search on JS-rendered content can still be invisible to the AI answer layer. Do not assume the two behave the same.
How do I check whether my content is server-rendered? #
Fetch the page without a browser and read the raw HTML, for example with curl, or use view-source in the browser. If the headings, body text, prices, specifications and Schema.org markup are present in that raw HTML, AI assistants can read them. If they only appear after JavaScript executes, move them to server-side rendering.
What does this change about how I should build sites for AI visibility? #
Serve the load-bearing facts in server-rendered HTML with valid Schema.org, exactly as classic SEO has advised for years. Static site generation or server-side rendering both work. Client-side single-page-app patterns that inject the main content after load are the risk. This is the same conclusion as serving clean semantic HTML to agents generally.

Need an FAQ tailored to your industry and market? We can build one aligned with your business goals.

Let’s discuss

Related Articles

We pointed AI-visibility monitoring at our own site for a quarter. The numbers were humbling, and the measurement method moved them more than reality did. Three real snapshots, the caveats, and what we now track.
seo

Measuring AI visibility

We pointed AI-visibility monitoring at our own site for a quarter. The numbers were humbling, and the measurement method moved them more than reality did. Three real snapshots, the caveats, and what we now track.

The 2026 debate over how to serve content to AI agents conflates three different layers. A practitioner view from a stack that already serves clean semantic HTML and Schema on Cloudflare.
technology

Serving content to AI agents: HTML vs Markdown, and where OKF actually fits

The 2026 debate over how to serve content to AI agents conflates three different layers. A practitioner view from a stack that already serves clean semantic HTML and Schema on Cloudflare.

Which Schema.org types matter for AI search engines? Practical guide to AEO and GEO optimization - making your content discoverable by ChatGPT, Perplexity, Google AI Mode, and answer engines.
wordpress

Schema.org for AI Search: How to Appear in ChatGPT, Perplexity, and Google AI Mode

Which Schema.org types matter for AI search engines? Practical guide to AEO and GEO optimization - making your content discoverable by ChatGPT, Perplexity, Google AI Mode, and answer engines.