Blog Why your site should work without JavaScript first
Why your site should work without JavaScript first
TL;DR Build the core, links, forms, content, in HTML that works on its own, then layer JavaScript on top to enhance it. The page loads faster, survives a failed script, works for more users, and is easier to maintain. JavaScript becomes an upgrade, not a single point of failure.
"Works without JavaScript" sounds like a stance for purists. It is really about resilience. When the core of your site is HTML that stands on its own, and JavaScript is the layer on top, everything gets more robust. Here is the case.
The idea
Progressive enhancement means building in layers. The base layer is HTML: real links, real forms, real content that works with nothing else. On top of that, JavaScript adds richness, instant interactions, client-side updates, niceties. Users with a fast device and working scripts get the enhanced version. Everyone else still gets a functioning site.
The difference from a JavaScript-first app is where the failure line sits. In an HTML-first site, a script failing means a slightly less fancy but working page. In a JavaScript-first app, a script failing can mean a blank screen.
Why it matters more than "who disables JS"
Almost nobody turns JavaScript off on purpose. That is the wrong question. JavaScript fails constantly for reasons that have nothing to do with choice: a flaky network drops a bundle, a single script error halts execution, a slow phone times out, a corporate proxy or blocker mangles a request. When the whole experience depends on that script arriving and running perfectly, every one of those becomes a broken page.
HTML-first means those failures degrade instead of breaking.
What you get
- Speed. The content is in the initial HTML, so it shows immediately instead of waiting on a bundle.
- Resilience. A failed or slow script leaves a working page, not a blank one.
- Accessibility. Native HTML elements come with keyboard and screen-reader behaviour that hand-built JavaScript versions often miss.
- Simplicity. Enhancing working HTML is frequently less code than making everything depend on a framework.
The mindset
Start with the thing that works, then make it nicer. A link before a click handler, a form that posts before a fancy async submit, content in the HTML before a client-side render. JavaScript becomes an upgrade you layer on, not a single point of failure the whole site hangs from. That is a more robust way to build, and often a simpler one.
FAQ
Does 'work without JavaScript' mean no JavaScript at all?
No. It means the core, reading content, following links, submitting forms, works in HTML alone, and JavaScript enhances it. Users with JavaScript get the richer version; everyone still gets a working site. This is called progressive enhancement.
Who actually has JavaScript disabled?
Very few people disable it deliberately, but JavaScript fails for many reasons: a network hiccup, a script error, a slow device timing out, an aggressive blocker. Building HTML-first means those failures degrade gracefully instead of leaving a blank page.
Isn't this more work?
Often it is less. Starting from working HTML and enhancing it tends to produce simpler, more maintainable code than making everything depend on a JavaScript framework. And you get resilience and accessibility largely for free.