You shouldn't try and find ways to add unnecessary javascript to your page.
Some web clients, like TTY-based clients, ignore both JavaScript AND CSS. People using these clients rightly expect to get a worse web experience overall. But if you can make a functional web page for them, why wouldn’t you?
These both sound like relatively niche edge cases. But nobody knows how things will change in the future.
I wrote another post about building a search form about progressively enhancing a search form (https://jch.github.io/posts/2025-01-30-building-modern-searc...). Starting with semantic <search> and <input> elements gives sane browser and screenreader behavior.
Perhaps my title came on too strong, but I'm not advocating against javascript. It's more about understanding capabilities HTML and CSS can handle, and what is better suited for JS.
This inspired me to explore what the simplest possible framework/site generator could be, that still has great DX: https://mastrojs.github.io/
When I was reading the header/footer section, it reminded me of this issue to push for first-class includes in web platform https://github.com/whatwg/html/issues/2791
jollyjerry•4mo ago
joz1-k•4mo ago
JavaScript was considered as a unstable and under-specified part of the Web in the "Dynamic HTML" era somewhere between 1997-2006, when Microsoft Internet Explorer implementation of DOM diverged from more standard Netscape/Firefox in many tricky ways. This has largely been solved by better standards, initiatives like Acid tests and (unfortunately) slowly spiraling into Blink engine monoculture.
jollyjerry•4mo ago
I see this as different layers of stability. On the bottom is a solid foundation of web standards that's widely adopted and resilient to breaking changes. Layered on that is the web framework and language. Before ruby, I really enjoyed perl, so I've experienced the collapse of a language and community. Matz had some good insights drawn from the history of other languages https://www.youtube.com/watch?v=4MM5b2F9zrM
Javascript is fascinating because of its evolution. Its initial popularity and wide install base guaranteed a lot of resources for it to grow. I'm excited to see whether wasm can bring more languages to the web.