Hacker News new | ask | show | jobs
by zwaps 1911 days ago
Why is turning off javascript silly?

Not that I personally disable all JS in my browser, but I'd say if your website can not be displayed without Javascript, then it is silly.

1 comments

At one point I might have agreed with you, but after working on a few sites of my own I found that Javascript just enables a vastly better user experience. No need to refresh the page every time the user does something like liking a post or sending a comment, can load content more seamlessly with pre-loading or lazy loading, enables expandable menu bars to maximize space for content when the menu's not in use, things can be loaded faster and with less data usage if you send page diffs instead of full pages of markup, etc.

Javascript's terrible when it's used to generate pages from bloated frameworks that create 5000 DOM elements, add listeners to everything, load a dozen external scripts, and so on, but it's really valuable when used to actually improve the user experience.

Like you can probably guess, people tend to disable JS not because it can technically enable a good user experience.

Rather, they do so because it enables a majority of websites, and this includes big names like news websites, to create an absolutely horrible user experience - even if, or seemingly because, the content profits in no way from JS.

If you have ever tried to surf on an older laptop recently, you will get what I mean.

Everything you described can be done with progressive enhancement.

Only three engines exist that work well with JS; if we want our sites to not be dependent on behemoths like Google and Apple (Google is Mozilla's income source), we need to build sites that don't depend on their software (Blink, Webkit, and Gecko). That typically means not requiring JS.

People who block JS do so for good reason: when they open your site, they have no reason to believe that the JS being served isn't malware. If they disable and inspect it, they have no reason to believe that the scripts won't change the next time they open your page. It's safer to just leave it disabled.