If your site doesn't work without JavaScript you could be missing out

In recent years, front-end development has exploded into a seemingly larger industry than back-end development, driven by new libraries and frameworks.

Progressive Enhancement

Ten years ago, progressive enhancement was all the rage. Build a site's back-end first, make sure it all works perfectly, and if there's time at the end – add the JavaScript bells and whistles. JavaScript was a beast; functioning somewhat differently across browsers and platforms, it was waiting for some help.

jQuery came along and the number of websites that contained some sort of interactivity without reloading started to balloon. Along with the nice new interactive sites came a dark side – developers that weren't really sure what they were doing, but being driven by hungry project managers they were forced into copying and pasting things they found that worked.

Spaghetti code gets a bad name because it has the potential to make something grow out of control and become very difficult to alter later. It's important to remember though that sometimes, a simple function is all you need. But we're on a quest for perfection!


To deal with the problem of spaghetti code, advanced developers started to use better design patterns including modules, prototypes, and singletons. Along with these structures came a relatively new phenomenon to the JavaScript world: frameworks. These frameworks aim to abstract away the complexity of design structures whilst simultaneously providing a framework of functionality to create application style websites.

The drawback to this is that most of those developers haven't yet figured out how to have all of this new functionality while still keeping the underlying baseline of functionality for situations in which JavaScript is unavailable. I've heard all sorts of excuses, from progressive enhancement is no longer important, to nobody disables JavaScript anymore.

JavaScript required

You've probably heard of the term 'web app' in recent years. In my experience this is a buzzword which can be defined thus:

A website which is overly reliant on JavaScript to perform operations which should probably be handled on the server instead, and absolutely requires JavaScript support because of this.

A large number of websites now class themselves as web apps. Try disabling JavaScript and witness the horror, or glory. If you've ever asked yourself if your website should work without JavaScript and then decided it wasn't important because your whole codebase is now inside your JavaScript and replicating it on the server side would be a pain, know this:

Facebook works without JavaScript. Yes, it's a very cut down old looking mobile style site, but it works. Ok, so it's not progressively enhanced, it's a mobile domain – but the point is it works. And if Facebook is doing it, there's a very good reason for it.

Everyone uses JavaScript except for everyone that isn't

JavaScript might not be available for any number of reasons. It's disabled (the most unlikely), it failed to load because it's on a remote CDN which is down, it failed to run because a third-party script loaded first but contains error, it was blocked by a web application firewall, etc.

Who would block your JavaScript? Corporations, those companies with the most money to throw around. The government conducted a survey and found 1 in 93 users don't load JavaScript. 1 in 93 isn't a large figure, but if that represents 50% of the potential income for your business, shouldn't you have a non-JavaScript solution too?

Ultimately it comes down to progressive enhancement, which I'd very strongly recommend you towards. I'd also guide you away from those frameworks – they're making you code badly. HTML should never be in JavaScript (don't tell me it's not HTML – it is) and yes it's absolutely worse than doing it on the server side because of caching. Every hit to your website should be cached to some degree, and for the end user that's faster when code generation isn't on their machine. If your entire site builds itself from JavaScript then it has to do that every time the page is loaded. Take a look at how slow Wix websites are, if you don't think that's a problem.

This JavaScript generation multiplied several times across third-party content such as adverts, is one explanation for why many sites now run slowly and judder on mobile phones. I've seen people pull in entire frameworks to achieve something that could have been achieved with a single line of ordinary JavaScript.

Amazon S3 went down for a while last week and took many sites along with it, Google hosted libraries has fallen over in the past too. Frameworks may be encouraging you to write somewhat less spaghetti code, but they're also making your websites worse when things go wrong. And if things are worse, why are you really using a framework?


Progressively enhance code which gives at least basic functionality for your site. If you choose to use a framework, make sure you know why you're using one, and how to prevent issues if it fails. When I'm asked to audit a site I will always deduct big marks for a site which doesn't function to a basic level without JavaScript – the same way I used to deduct marks for when Flash failed.