Skip to main content
eladnarra's site

Browsing the Web Without JavaScript

It's JS Naked Day (or thereabouts)!

Join us for the annual festivity of going without JavaScript on the Web!

JS Naked Day promotes the rule of least power. That is: start with HTML for semantic markup and CSS for styling. Use the web platform (especially forms!) for interactivity. And then, progressively upgrade with JavaScript for advanced interactivity. In plain terms: your website should work without JavaScript enabled.

[...]

On April 24, simply remove all JavaScript from your website. JS Naked Day lasts for one international day. Technically speaking, it will be April 24 somewhere in the world for 50 hours:

My site doesn't have JavaScript (yet), so technically I'm participating by default. So in order to put some effort into my participation, this felt like a good time to write about something that's been on my mind lately: things I've noticed when browsing without JavaScript.

The NoScript Extension

Many, many moons ago, my dad installed the NoScript extension on my browser. I was a kid and didn't understand exactly what JavaScript was, but at the time he told me it was a safety precaution, to avoid nasty scripts executing without permission.

But even 20-25 years ago, blocking JavaScript on every page was a pain. Things broke without it, so I often found myself temporarily enabling everything on a page.

NoScript eventually disappeared from my browser extensions in one of my moves between devices, somewhat replaced with ad blockers (and now uBlock Origin). But recently someone I follow on Mastodon posted about using it, and I installed it again out of curiosity.

Websites Without JavaScript in 2024

I wasn't particularly surprised at what broke, at least not at first. Social media websites and those that rely on client-side frameworks like React are blank or tell me to turn on JavaScript. All the websites associated with my healthcare break, too.

But some things did surprise me. Many Squarespace websites have no body text at all, even when I allow JavaScript for the domain — i's only when I enable scripts from Squarespace that the text appears, animating into view as I scroll.

Mobile menus have also proved to be an issue much more often than I expected. Without JavaScript, many become completely inaccessible. This problem arises when the menu is hidden with CSS and then shown using JavaScript when you click the button. So if JavaScript is disabled or fails to load, the button doesn't work and the menu stays hidden.

(I made this mistake the first time I created a mobile menu for a class project, but for some reason I expected professional websites to degrade a bit more gracefully. If I ever add a mobile menu to this website, I'll hide the menu using JavaScript instead of CSS. No JavaScript? No problem! The menu will still be visible, not hidden behind a useless button.)

The thing that continues to surprise me, though, is just how many domains are listed for some sites. If something isn't working on a page, such as an image carousel or search function, I open NoScript and selectively enable the domains that look most promising. Sometimes it's easy, like simply enabling the main domain. Other times I'm met with 10 to 20 different domains, many of them inscrutable CDNs or services I've never heard of.

The Upsides

On the other hand, some websites work just fine without JavaScript, many of them in the small/indie web ecosystem. And for those that do require it for certain features like theme switchers, they aren't necessary to actually read the page's content.

Even more happily, some websites work better without JavaScript. Layouts stop shifting and jumping underneath my fingers, reducing misclicks. Videos stop autoplaying or disappear entirely. Many paywalls crumble without the help of JavaScript. (Although some websites like the NYT, alas, have moved to more effective paywall measures.)

This experience has also made me more confident about my plans for JavaScript on this website. I was already planning to add it only after working on HTML and CSS. And I've always been a fan of progressive enhancement.

But browsing without JavaScript has made me really consider whether this website needs JavaScript at all (aside from accessibility improvements). Do I need a mobile menu hidden away when I have so few top-level pages? If I want to display a photography gallery, do I really need a lightbox/modal to do so?

Final Thoughts

My growing tendencies towards JavaScript minimalism might be too much for some, but if you make a website I encourage you to join JS Naked Day (or plan to join next year!). You might learn which parts are more fragile and could benefit from progressive enhancement — or you might even see places you can cut back on JavaScript and increase performance.

And if you don't have a website, JS Naked Day has a recommendation for you, too! You can join me browsing without JavaScript:

On April 24, disable JavaScript in your browser (Chrome, Edge, Firefox, Safari) and surf the web. For sites that do not work without JavaScript, consider reporting a bug with that site's maintainers.