Live data from Hacker News

Your website should work without JavaScript (2021)

endtimes.dev

71–80 of 159 posts

Re: Your website should work without JavaScript (2021)

#71
post #16

i don't think vanilla html saves more bandwidth than JavaScript. if a part of your website needs update (react,vue,fetch) only that part is transmitted over the wire. It's also less jarring for the user, since most browsers would scroll the content to the top. Also, without JavaScript, some webapps would require storing user state in a server database rather than in memory of the browser. Fix html and we won't need J…

> It's also less jarring for the user,

Jarring for the user? Are your users cavemen with severe PTSD? Loading a web page is not a "jarring" experience for anyone. Was the first load of your page "jarring"? Was loading a new page "jarring"?

This idea that users are hyper delicate flowers is ludicrous. Having a page stuck with a bunch of gray gradient placeholder elements while JavaScript loads and does whatever is far more jarring than a page that just loads.

Edit: autocorrect can get bent

Re: Your website should work without JavaScript (2021)

#72
post #70
post #68

Earlier quoted context omitted.

The comment you replied to says > if I choose to let it run at all, which I won't if I can avoid it. It's not rare for people with a security/privacy background to only allow whitelisted sites to run JS.

And - what's the point? Websites that want to track you will track you anyway, there's a whole array of technologies that will let them to, and won't display anything to you if you don't run JS. Security objections are pointless, it's not 2001, JS is not anything new, and it's not at all a security risk, browsers are sandboxed and well isolated.

The objections to JS on security grounds are not about tracking. Browsers doing JIT are not as isolated as you may wish them to be.

Re: Your website should work without JavaScript (2021)

#73
post #61

Purists who refuse to load websites with JS are such a small percentage of visitors they can be safely ignored. It's an uphill battle that they're losing very fast. I don't think you can use more than 5% of websites without JS in any capacity. The whole point of websites is lost if they can't track visitors, see what they're paying attention to, and how to manipulate their behavior. Everyone's doing it, and if you do…

> Purists who refuse to load websites with JS are such a small percentage of visitors they can be safely ignored.

Except they are not[0]. Besides micro browsers there's screen readers that can't even use sites that customize a bunch of div elements with no accessibility tags.

[0] https://24ways.org/2019/microbrowsers-are-everywhere/

Re: Your website should work without JavaScript (2021)

#74

Earlier quoted context omitted.

Good points. I might even go a step further and say that not only should you be AWARE of how your page behaves after the magic (what breaks without JS, what doesn't), you should deliberately pick and CHOOSE what's OK to break and what is essential content, and design around it. An example: At my last job (a museum), accessibility was a business need (and grantmaker requirement), and part of that is ensuring that our…

> you should deliberately pick and CHOOSE what's OK to break Absolutely. Unfortunately this is harder to do in a Next.js world, because it’s obscured by abstractions. Life was much easier when you were clearly writing regular HTML and enhancing it with specific JavaScript because the whole thing was deliberate. With JavaScript frontend frameworks plus server-side rendering, the default is to be unaware of all of this…

> With JavaScript frontend frameworks plus server-side rendering, the default is to be unaware of all of this stuff and you have to go at least a little out of your way to do it properly.

Too true. In 20 years of web dev, my job has largely gone from "writing inscrutable code" to "reverse engineering someone else's inscrutable code".

Heh, that's part of the joy though. Now it's no longer "production is down again, fix it!" it's "oh, AWS is down, wanna grab a coffee while we wait?". Or on the FE, "oh, I found the bug and submitted an issue on their Github, hopefully they'll fix it in the next version".

Re: Your website should work without JavaScript (2021)

#75

> Downloading d3.js (a popular graphing library) costs 1 cent in Canada. In Mauritania it costs 0.06% of the average daily income. The whatdoesmysitecost.com links are now broken and that site as a whole seems to be fairly broken, but it was discussed here last year: https://news.ycombinator.com/item?id=27759583 . They claim that the method they used to decide prices is a best-case scenario, but in reality it’s gener…

He also mentions Lynx. I use w3m quite a lot myself in tmux sessions. In fact, I have about two dozen tabs open in w3m right now.

And there is still quite a lot of content out there that works without JS. For example, https://lib.rs/ is lightweight and fast pure rust alternative to crates.io that works great in my tmux session, which is pretty awesome if I'm doing rust stuff in a terminal. (it was originally written as a replacement for the official site which rejected it due to the maintaners being more familiar with their JS implementation)

Re: Your website should work without JavaScript (2021)

#76

> Downloading d3.js (a popular graphing library) costs 1 cent in Canada. In Mauritania it costs 0.06% of the average daily income. The whatdoesmysitecost.com links are now broken and that site as a whole seems to be fairly broken, but it was discussed here last year: https://news.ycombinator.com/item?id=27759583 . They claim that the method they used to decide prices is a best-case scenario, but in reality it’s gener…

Those bits about the price in Canada feel like clickbait: technically possible, but with caveats learned only after clicking, like perhaps it's only experienced by people with non-Canadian SIMs who decide to use a terrible roaming plan instead of something better? But with the links being dead, this is just speculation -- not writing in this format (of third-party dependencies filling in what appear to be major gaps)…

I don't know about actual canadian prices, but I do visit canada periodically, and only once was I in a position to go through the complexity of acquiring a roaming SIM. My cost is 20¢ per megabyte.

The last time I was there for a week I made sure to exclusively use Firefox+NoScript and setup a number of large regions in google map caching - in past I also used Firefox data saver image option, but regrettably they removed that from the config (hm, I wonder if it's still available in about:config as a hidden option - shame they also blocked about:config unless you use a non-mozilla build)

(my suspicion is it was probably one of the many cool features lost in the rewrite)

There are still data limited cell plans in the US though. Quite a few sold by T-Mobile partner resellers as economy plans.

Re: Your website should work without JavaScript (2021)

#77
post #2

As recent as 2016 I was building some sites without any JavaScript. These weren’t small sites either. You can achieve a lot using some basic forms. It was quite fun

95% of the functionality web apps I've been put in charge of building works without JavaScript. You do lose things like form validation, and some of the links to things like detail forms opens in the same window instead. Or, say, a master/detail selection having a full list of hundreds of items instead of 90% of them hidden based on

It's useful for most of the reasons listed in the parent article.

You can also do quite a lot in CSS these days for interactivity - and with better performance than JS. Expand/collapse sections (with animation), menus including transition delay for more mouse forgiveness, slide out panels.. Also pretty easy to then tweak it for alternate mobile layout.

Re: Your website should work without JavaScript (2021)

#78
post #63

I read HN a lot, this topic always comes up so I said “I’m going to build a site that makes these readers happy. Take all their advice, no JS at all. Everything done in HTML. Everything they’re asking for” Turns out the hardest thing to do is to get people to use your site.

> Take all their advice This site is horrible to take advice from. I would sooner ask why other people are doing things in a given way before trusting the HN hivemind to give advice on how to build a successful product.

Ironic, isn't it, when HN is directly related to a startup accelerator with many successful products and companies.

Re: Your website should work without JavaScript (2021)

#79
post #2

As recent as 2016 I was building some sites without any JavaScript. These weren’t small sites either. You can achieve a lot using some basic forms. It was quite fun

95% of the functionality web apps I've been put in charge of building works without JavaScript. You do lose things like form validation, and some of the links to things like detail forms opens in the same window instead. Or, say, a master/detail selection having a full list of hundreds of items instead of 90% of them hidden based on It's useful for most of the reasons listed in the parent article. You can also do qui…

HTML and CSS have form validation too. You can do something like :has(:valid) when you add in your validation schema in the HTML.

Re: Your website should work without JavaScript (2021)

#80

Earlier quoted context omitted.

"I Turned Off JavaScript for a Whole Week and It Was Glorious - Wired 2015" It's not 2015 or 2016 anymore, not even close. We're the better part of a decade moved on. This is not a valid argument any longer. JavaScript is a critical part of the modern web experience. You may not like it, but that doesn't change the fact.

I just read through that article. Of the specific things it mentions, I think Twitter might no longer work without JavaScript, but everything else is true now just as it was then. Nothing has changed. Source: personal experience, as one who blocks JavaScript by default because it makes the web better more than it breaks things. Also very occasional observation of people browsing the web with very similarly-configured…

I block 3rd-party JS by default. (I'm not sure who the second party is supposed to be, I guess that's me). I'll take JS that you serve me yourself.

Basically, I'm willing to trust a site that I've deliberately visited; but if they want to load a score of scripts from sites I haven't deliberately visited, and I can't see content without them, I'm outa there. Often these are big scripts; and the site-owner can't possibly be vouching for them, if he's not even serving them himself.

I think linking out to 3rd-party Javascript is lazy and irresponsible. Any testing you've done on it could become obsolete at any time, without notice. It's done to avoid having to keep up with patches; "No, I don't know what version of JQuery you got served; you were supposed to get served the latest".

Post reply on HN