There is no pushback on it because as long as it works, people are happy and continue paying. And none of the clients test with js disabled.
Devs use it because the moment the client needs something somewhat dynamic, some js will need to be included anyway so you might as well use your usual stack.
Basically "why do people use js where HTML does the trick" is the same question as "why do people use python where c89 does the trick"
But the web evolved to be way more than being a dumb content delivery pipe, it's an application development platform bypassing the underlying OS.
So ask yourself, if you need well behaved image galleries, do you need JS? Yes. Do you want to avoid page reloading to navigate? You need JS. Do you want login/form validation? You need JS. Need an inline calculator? Update content from the server? Monitor the progress of a long lasting server job? Add any logic to a shopping cart?
And these are very simple use cases, web apps are needless to say changed the way we ship apps and they all rely on JS.
I'm very much in support of offloading as many tasks to CSS as possible, but JS is hard to avoid if you want to do anything beyond static content delivery.
Reminds me of emails and newsletters. Yes, they have many legitimate uses, but that doesn’t change the fact that a large part of them are just plain crap.
I feel like both sides of the debate are refusing to admit the other side might also have some valid points. Which admittably seems to be the theme in all of the internet.
But it can be done right. dev.to is a great example of an interactive web application with all the bells and whistles, yet it still performs better than most static sites.
I have no idea why they would do that. It looks like a misconfigurated preprocessor that thinks each fragment is a doc of its own. I vaguely recall something about them open-sourcing the frontend, so I might look into that...
https://github.com/thepracticaldev/dev.to/blob/master/app/vi...
> Browsers are very resistent to garbage markup
Miraculously so! Anything I would have attempted to design would have crapped its pants at the look of this markup, but browsers heroically manage to display it as if nothing weird is happening. I take my hat off to their resilience.
PRs welcome. :)
The cause is split pretty evenly between web developers who don't care about what they build enough to learn how to do it well, and companies who employ them letting them do that rather than pushing them to improve, and client's who don't understand what they've bought well enough to complain.
Everything is like that though. It's not limited to websites. Everything has problems, and it's always someone's fault. Developers tend to notice websites because we use them a lot and (some of us) think it's just laziness on the part of the website dev, but if you were an electrician you'd see problems with powertools, or a nurse you'd see issues with drug companies, and so on. The world is imperfect.
I used to be a full-stack developers, trying to balance my apps/pages just right between the server and browser side. But lately it's much easier to just focus on building APIs and let the front-end devs deal with all the interaction, forms and other user-facing stuff.
The interesting question, then, is what horribly wrong incentives are at work to make web developers accept slow sites (and other trends of bad design like "dark UI patterns" and data collection).
I am constantly surprised at the number of people that explicitly disable JavaScript to make their lives difficult in 2018.
My point is, JavaScript makes it easy to build nice websites at scale. Plenty of CMS platforms (like Wix.com) use JavaScript by default.
If 99.9999999% of people are fine with JavaScript, then why should a website cater to your need by providing a version specific to people who disable JavaScript?
> build nice websites at scale
> at scale
What? Might as well mention ML & blockchain while we're at it.
If site is not interactive, it doesn't _need_ JS.
If it does need JS, it more than likely needs _sprinkles_ of it.
Also, interactivity almost always gives better UX than static websites, if it's done properly by a professional website builder like Wix or Squarespace. So there's not much to hate it except maybe a few MB of extra code that you need to download.
I can't think of any good use cases for static websites in 2018, except maybe blogs in pure plaintext or old fashioned forums. Even HN has JavaScript for that little bit of interactivity (collapsing comments).
This sounds like double-speak. That's not what at scale refers to, even allowing a very loose definition.
How the HTML is generated is moot. Server side templates had re-usability at a "component" level. iFrames exist, redirects exist.
I'm not saying all JS is bad. I'm saying too may new people seem to think JS in and of itself is magic and there is no other way to generate/manipulate the DOM or talk to other computers.
I'm bailing out of this conversation now because you're heavily conflating HTML, browser functionality and www fundamentals with website builders(i don't know why you felt the need to qualify it with "professional")
> Even HN has JavaScript for that little bit of interactivity (collapsing comments).
Yeah no, "even HN" works perfectly with JS blocked. JS for HN is an enhancement, not a requirement. They understand how the web can work...
Many web developers are familiar with React, Angular, or other front-end frameworks; they are familiar with the deployment process, and the tools around it. If they need to build a website, they will use these tools, regardless of the requirements of the website.
I'll by the lazy developer / uninformed business owner explanation or the flash cancer analogy, but the tracking explanation seems a little far-fetched.
I get that Facebook, Amazon, Apple, and Google are all running ad networks trying to track me, and that globally this accounts for most of the bloat.
I'm trying to understand the dynamic that causes what should be simple static websites to use JS in such a way that they display no information at all when JS is off.
I am constantly surprised at the number of sites that should be totally static (e.g. a local restaurant's menu page) that display nothing at all when I visit with JavaScript disabled.
Can someone who actually makes websites explain why this has happened? Is this about varying screen resolutions and aspect ratios in the era of phones and tablets? Can't you just use CSS instead?