Live data from Hacker News

A day without JavaScript

sonniesedge.co.uk

101–110 of 412 posts

Re: A day without JavaScript

#101
post #4

Say what you will about jQuery, but it made graceful degradation easy (and encouraged). I do miss the days when people considered JavaScript an enhancement and not a dependency.

It was called progressive enchancement[^1] back in the days and it was good for you. [^1]: https://en.wikipedia.org/wiki/Progressive_enhancement

It still is?

Re: A day without JavaScript

#102
post #42

Ironically, this articles confirms that investing into the no-JS functionality is becoming less and less important, with those major sites already forcing the user into JS. Why then would you invest your time and money to cater to the "eccentric" 1%?

Because of those 1% the large majority don’t choose to turn it off but don’t have it available for a multitude of reasons outside of their control.

Re: A day without JavaScript

#103
post #11

Earlier quoted context omitted.

Not really an answer to your question, but this might be useful: http://youmightnotneedjquery.com

Yeah. Except you need to do Ajax and fetch doesn't cut it. So new lib. And manipulate the dom with something better then the browser API or you loose your mind. So new lib. Then normalize browser events. Oh wait, you can do that manually. But you are writing a new lib. Eventually the code will grow to be the size of jQuery anyway. Only not as well tested, documented and cached.

You can implement an minimal ajax interface in js (no jquery) in less than 30 LOC. But I grasp what you mean, it not just that. There are other concerns and requirements and you do not want to reinvent the wheel everytime...

Re: A day without JavaScript

#104
I just did the same experiment and, coincidentally, also checked feedly, only to receive a totally blank page. However, a little digging revealed an intent on feedly's part to handle this case. They have a 'feedlyBlocked' element, with content, that is simply fixed to "opacity: 0"; obviously, without javascript enabled, they can't then dynamically display that content. Another approach required.

As an aside, it's very difficult to contact feedly directly, but they do have a uservoice account (https://feedly.uservoice.com).

Re: A day without JavaScript

#105

>Verdict: Cartography catastrophe. As much as I hate JavaScript, Google Maps gets a pass. I'm pretty sure the code behind it is thoroughly tested. We can just suck it up and turn JavaScript on for one of the most useful tools from the internet -- how hard is it to find something that whitelists domains to run JS anyway?

There should be something as a fallback, though, surely? Take out all the functionality, by all means, but at least give me a map image. If you can't even get link-to-zoom working to display different images, just give me a map image based on my IP location; give me anything rather than nothing.

Re: A day without JavaScript

#106
post #82

Earlier quoted context omitted.

I honestly think the security/privacy arguments are the only valid argument against requiring JS as standard. The idea of browsers sending data that the user has explicitly elected to send (in addition to, if we're being pedantic, that the server put there in the first place) is very compelling in this day and age - only problem being that in order for that to have any meaningful impact on web security in the general…

What about power consumption as another valid argument? Your battery will last longer without Javascript.

That would be a valid reason to provide a JS alternative depending on context, not so much a valid argument for JS-free alternatives as standard.

There will always be something you can do to reduce power consumption: expecting (or advocating) JS-free versions of all websites for that reason is a completely arbitrary line to draw.

Re: A day without JavaScript

#107
post #87

Earlier quoted context omitted.

It will last even longer without CSS

And most websites that work without JS also work fine without CSS. Almost like a pattern that can be found in properly built websites.

WTF? You do realize most of the users on the internet don't even know what CSS/JS is and would be thoroughly displeased at being presented with a page with no styling. They don't appreciate that the rendering is done without JS/CSS. A properly built website is one that caters to most users, not developers or power users concerned about JS being enabled in 2017.

Re: A day without JavaScript

#108
post #32

Earlier quoted context omitted.

> Yeah. Except you need to do Ajax and fetch doesn't cut it. So new lib. Why doesn't fetch and its polyfill cut it?

Polyfill. So new lib. And even then. You need to encode params manually. And of course no middleware, so for special decoding or repeating headers, you end up writting a wrapper.

Programming is mostly creating functions and interfaces to decompose problems into reusable parts where reuse makes sense. Nothing wrong with creating a simple function for making XMLHttpRequests or for fetch API. Most of the time there's no need for the level of generality of jQuery interfaces.

Just by making a function you're not creating a library. Sometimes I find DOM API verbose too. Nevertheless the fix does not need to be a interface like jQuery to completely hide DOM API under another interface. It may be enough to extend the HTMLElement prototype a bit or write a function to "compress" the code a bit and make it more readable.

Re: A day without JavaScript

#109
post #32

Earlier quoted context omitted.

> Yeah. Except you need to do Ajax and fetch doesn't cut it. So new lib. Why doesn't fetch and its polyfill cut it?

Polyfill. So new lib. And even then. You need to encode params manually. And of course no middleware, so for special decoding or repeating headers, you end up writting a wrapper.

No, a polyfill is not a library. It's a dozen lines, not a thousand.

Re: A day without JavaScript

#110
post #100

Earlier quoted context omitted.

And most websites that work without JS also work fine without CSS. Almost like a pattern that can be found in properly built websites.

Why doesn't the market care? Where is the JS-less Facebook/Twitter/Airbnb competitor that blows the customers away with "properly built" websites?

As the number of people that won't put up with the JS crap anymore and start using JS blockers increase, we will see such websites.

Same thing that is happening with ads and ad blockers.

Post reply on HN