Hacker News new | ask | show | jobs
by manbearpiggy 2548 days ago
Web pages should be designed to load without js.
6 comments

Web pages that don't show anything without JS are broken. Ones that show only a message about enabling JS are worse. It seems JS;DR was already a thing long before I felt the need for it yesterday, when I simply missed that article about synths at ableton.com because it was broken. https://indieweb.org/js;dr
What about web applications? I am the office champion of accessible web, but recently we made a web based game, in canvas. Without js, there's no game engine, so we had a noscript tag.

That synths article uses built in JavaScript synths (using audio apis). I agree the text should display without JavaScript but the purpose of the article (get hands on with synths) is eliminated without JS.

Basically, the web not only is a document delivery place, it's also the new Newgrounds. None of those games would work if you disabled flash, why should web applications (beyond ones that are simple documents) work without JavaScript?

> > Web pages that don't show anything without JS are broken.

> What about web applications?

I would say is depends upon the application.

A data entry and simple reporting service? That should definitely be accessible and can easily be made to work without JS. Though some scripting might be acceptable: modern screen readers will cope and holding back for people with ancient screen readers is no different to holding back because some people still use IE or Android 4.4 (though do some research/testing to see what they actually w{ill|on't} commonly cope with).

If it is an interactive game or similar then you are not going to replace that practically with form submissions and no JS, so by all means don't bother caring that it doesn't work without JS. Though do make sure you include a <noscript> tag if otherwise nothing useful would display, just so users know what is going on and there isn't a fault at their end or a fault in your app that they should report.

Anything between is a grey area: you'll have to use your best judgement of your actual and potential target audiences. Though again, make sure something useful displays for everyone even if that is just a polite "sorry, we can't get this working for you" message.

> but the purpose of the article (get hands on with synths) is eliminated without JS.

If there is nothing to read, there is no way to know there is any app, let alone decide that I want it to run.

> why should web applications (beyond ones that are simple documents) work without JavaScript?

I imagine that the other kind of web app does everything with POST and forms and such like it's 2003, and I can understand that you'd prefer not to. I'm not saying they should or that they must all do without JS. I'm saying that if the article was a document that (also) documented the proper use of the web app within it then I would have liked to have been free to read it first. NoScript blocks <embed>ded things all the time and I temporarily allow them all the time. That workflow would have worked here, but if (as you seem to suggest is reasonable) the entire article was blocked because its app would be useless, then my strategy wasn't even considered, and someone is doing it wrong.

However, if a goal was to teach everyone to just run anything and everything and stop caring about privacy and security because it's a PITA, then someone is doing it right. I sure miss the good old days of Weekly_Report.doc.exe

If you like synths on the web, check this out.

https://learningsynths.ableton.com/

Cheers, but that is the exact article we're discussing lol
One of those linked articles hit HN 5 years ago and almost nobody cared. I use NoScript since 2005, and I'm watching more and more things break, and it's "unpleasant"

https://news.ycombinator.com/item?id=9247871

Or rather anyone starting a new project should think long and hard "is this a page or is this an app?". Too many web pages think of themselves as apps without any real reason to do so.
Developers used to building apps find it much more efficient to build that way and, to an extent, it is. I've had developers straight up refuse to build "legacy" pages, and I understand their reasoning. Sometimes that is the reason, when another is not apparent.
What do you mean when you say "should"? In an ideal world? Maybe. As it stands though, there is basically zero incentive to do so and quite a few incentives not to. Analytics, ads, referral networks etc. All of these require JS (at least the most popular solutions of the day) and if non of this works, what exactly is the reason to show you the page?
> What do you mean when you say "should"?

Probably "according to the original designers' intent," see this comment below you: https://news.ycombinator.com/item?id=20284550

You could turn it around to say that screen readers should support javascript. Some already do. They can execute the scripts and _then_ read the resulting DOM tree.
This. People have forgotten why the World Wide Web was needed to begin with, and nowadays think of it merely as an integrated delivery/communication platform.
If it wasn't intended to be a communication platform, then what was it intended to be?
Web pages should be designed to be standards-compliant. While you are free to turn JS off (and that's part of what makes the web great), you shouldn't be surprised if things break. Your browser is no longer standards-compliant.
Browsers are not required to support JavaScript; in fact, HTML has a specific tag to support this case.
Yes, but the standard recommends against actually using it.

>The noscript element is a blunt instrument. Sometimes, scripts might be enabled, but for some reason the page's script might fail. For this reason, it's generally better to avoid using noscript, and to instead design the script to change the page from being a scriptless page to a scripted page on the fly, as in the next example

https://html.spec.whatwg.org/multipage/scripting.html#the-no...

I think it's important to note that a "scriptless page" does not literally mean "give me a blank white page unless I turn on JavaScript".