Your website looks perfect in your browser, with its text, products and buttons. But your browser runs JavaScript without blinking, and Google's crawler does not always see exactly the same thing. When part of your content only exists after scripts run, there is a risk: Google may not see it, may see it late or may not index it.
That does not mean you should avoid JavaScript. It means you should know what your site relies on and check what Google actually receives.
How Google processes a page with JavaScript
Google works in three phases. First it crawls: it downloads the URL's HTML, as long as robots.txt allows it. Then it renders: it runs the JavaScript using an up-to-date version of the Chromium browser to obtain the page as a person would see it. Finally it indexes the result.
What you need to keep in mind is that rendering can happen after crawling, sometimes with a delay, and that the crawler does not behave like a visitor. It does not click, it does not scroll expecting more content to load, it does not log in or fill in forms. Whatever only appears after one of those actions normally does not exist for Google.
Server-side rendering versus client-side rendering
With client-side rendering, the server sends an almost empty HTML file (something like a <div id="app"></div>) and the browser builds the content when it runs the scripts. With server-side rendering (SSR), the HTML arrives already complete and JavaScript only adds interactivity. There is also static generation or prerendering, where pages are prepared in advance.
Serving the important content in the initial HTML is the safest approach: it does not depend on rendering working properly, it displays sooner, and it is understood by crawlers that do not run JavaScript, which do exist. That last point matters because several alternative search engines and AI assistant bots may not render scripts. Google has described so-called "dynamic rendering" as a stopgap, not as the long-term recommendation.
Content that goes unindexed because it loads late
The most common failures are these:
- Content that is only requested from the server when the user clicks a tab, an accordion or a "show more" button. If it is already on the page and merely hidden, Google usually sees it; if it loads on click, it does not.
- Infinite scroll without paginated URLs with links: the crawler does not scroll the page to load more.
- Links that are not links: buttons with onclick, or addresses using #. For Google to follow them, they need to be <a href="..."> with a real URL.
- JavaScript files, CSS or API calls blocked in robots.txt: if Google cannot load them, it renders an incomplete page.
- Critical tags (noindex, canonical, title) modified with JavaScript. If the original HTML already carries noindex, Google may never get to rendering the page.
- "Not found" pages in single-page applications that return a 200 code instead of a 404.
How to check what Google sees
Compare three views:
- Original HTML: the page source (Ctrl+U) or curl https://yoursite.com/page shows what arrives before scripts run. If your text is not there, it depends on JavaScript.
- Rendered HTML: in the browser's developer tools, the Elements tab shows the page once it has been built.
- What Google sees: in Search Console, use URL Inspection, click "Test live URL" and then "View tested page". You will see the rendered HTML, a screenshot and, under "More info", the resources that failed to load and JavaScript console errors.
For a quick test, turn off JavaScript from the developer tools (Ctrl+Shift+P and type "Disable JavaScript") and reload: whatever disappears depends on scripts. You can also search Google for an exact phrase in quotes together with site:yoursite.com to find out whether that text is indexed.
When not to worry, and what to ask your team
If your site is a traditional one (PHP or WordPress, for instance) whose HTML comes out of the server complete and JavaScript only adds menus, carousels or animations, the risk is low. If it is built with a framework such as React, Vue or Angular, ask whoever builds it whether it uses server-side rendering or prerendering, whether links are real links, whether non-existent pages return a genuine 404, and whether the title, description and canonical are in the initial HTML.
Frequently asked questions
Can Google index content generated with JavaScript?
Yes, in general it does, but with an extra rendering step that adds delay and can fail. That is why, for content you want to rank, it is more reliable for it to arrive in the HTML already.
Is server-side rendering always better?
For pages you want to rank it is usually the safest option. For private areas or tools behind a login, which Google does not need to index, client-side rendering poses no SEO problem.
Do AI assistants see content that loads with JavaScript?
It depends on each one, and several bots may not run scripts. If you want your content to be readable by them, the prudent approach is to have the essential text in the initial HTML.