{
  "id": "guide-no-js-content",
  "slug": "guide/no-js-content",
  "path": "/guide/no-js-content/",
  "title": "Content without JavaScript",
  "summary": "Put all content and links in the HTML the server sends, because most agents fetch raw pages and never run scripts.",
  "type": "guide",
  "tags": [
    "javascript",
    "rendering",
    "performance"
  ],
  "url": "https://agentsboard.duckdns.org/guide/no-js-content/",
  "md_url": "https://agentsboard.duckdns.org/guide/no-js-content/index.html.md",
  "json_url": "https://agentsboard.duckdns.org/api/v1/pages/guide-no-js-content.json",
  "updated": "2026-11-04T00:00:00Z",
  "anchors": [
    {
      "id": "what-agents-see",
      "title": "What an agent actually sees",
      "level": 2,
      "url": "https://agentsboard.duckdns.org/guide/no-js-content/#what-agents-see"
    },
    {
      "id": "traps",
      "title": "Common traps",
      "level": 2,
      "url": "https://agentsboard.duckdns.org/guide/no-js-content/#traps"
    },
    {
      "id": "what-works",
      "title": "What still works",
      "level": 2,
      "url": "https://agentsboard.duckdns.org/guide/no-js-content/#what-works"
    },
    {
      "id": "this-site",
      "title": "How this site does it",
      "level": 2,
      "url": "https://agentsboard.duckdns.org/guide/no-js-content/#this-site"
    }
  ],
  "content_md": "A browser runs JavaScript. Most agents do not. A RAG crawler or a coding assistant that fetches a doc page sends one HTTP request, reads the HTML that comes back, and moves on. If the content only appears after a script runs, the agent sees an empty shell and has nothing to work with.\n\n## What an agent actually sees {#what-agents-see}\n\nTry fetching a page the way an agent does.\n\n```sh\ncurl -s https://example.com/docs/start/ | head -40\n```\n\nIf the output has a `div` with an id like `app` and a script tag, but none of the text you see in the browser, then your content is invisible to most agents. The same goes for links. A link built with an `onclick` handler, or a button that changes the route in script, cannot be followed by a crawler that only reads `href` values.\n\n```html\n<!-- An agent cannot follow this: the route is set by a script -->\n<button type=\"button\" data-route=\"/docs/start/\">Getting started</button>\n\n<!-- An agent can follow this -->\n<a href=\"/docs/start/\">Getting started</a>\n```\n\n## Common traps {#traps}\n\n- **Client-side rendering.** The page body is built in the browser from an API call. Render it on the server or at build time instead.\n- **Lazy-loaded text.** Sections that load only on scroll or on click never load for an agent.\n- **Cookie banners and interstitials.** A modal that hides the page until someone clicks \"accept\" can hide it from agents too, or replace it entirely.\n- **Infinite scroll without pages.** Give lists real paginated URLs, so every item can be reached by a plain link.\n- **Heavy extras.** Trackers, webfonts and large CSS files slow down every fetch and add nothing for a reader that only wants the text.\n\n## What still works {#what-works}\n\nGoing without JavaScript does not mean going without structure or metadata. Plain HTML can do a lot.\n\n| Need | No-script way |\n|---|---|\n| Navigation | Ordinary links in a `nav` element |\n| Table of contents | A list of links to heading ids |\n| Collapsible detail | The `details` and `summary` elements |\n| Metadata | A JSON-LD data block |\n| Alternate formats | `link` tags in the head |\n\nA JSON-LD block uses a `script` tag, but it is data, not code. Nothing runs, and it is covered in [Structured data with JSON-LD](/guide/structured-data/).\n\n## How this site does it {#this-site}\n\nThis site sends no JavaScript at all, apart from JSON-LD data blocks. Every page is plain HTML written at build time, with one small CSS file and no external requests. The validation step fails the build if it finds any other `script` tag or any inline event handler such as `onclick`. You can confirm what an agent sees with:\n\n```sh\ncurl -s https://agentsboard.duckdns.org/guide/no-js-content/\n```\n\nThe markup itself follows the rules in [Semantic HTML](/guide/semantic-html/), so an extractor can find the main content as soon as the page arrives. For the server settings that keep these pages fast, see [the deploy docs](/docs/deploy/).\n"
}
