2 ms·
You can always detect whether tag <foo> is supported in JavaScript by testing whether HTLMFooElement is defined (but I understand you are speaking more generall
by jraph 7y ago
You can always detect whether tag <foo> is supported in JavaScript by testing whether HTLMFooElement is defined (but I understand you are speaking more generally).
I understand your feeling, and by making it usable without JavaScript you are already going a long way, but using those tags also makes your pages accessible.
Making your pages beautiful with animations is only extra. Things already work out of the box in any case without <details> without effort, only better if it is supported.
HTML is mostly designed to gracefully degrade, detection is not always necessary.
How would you like things to be handled? Handling retro compatibility is hard and I find HTML does a good job at it.
- grenoire 7y agoOut of a stance that is now more political than anything, the applications I've been building are entirely operating with server-side HTML templates with absolutely minimum to no JS (only for the occasional page load event or whatnot). When you respond to requests in under 100ms (plus network latency), you don't need an SPA layer to fool people into thinking that they're not in a web page. Bosses are particularly impressed with the speed.
- jraph 7y agoAnd I guess they are also simpler code wise? :-) I've built a website like that, for someone drawing comics. Fully works in simple HTML, looks better with CSS, and faster and slightly more enjoyable with JS. The JS avoids jumps and flashes (especially annoying since the website has a black background) when opening a page by only reloading relevant parts so the browser does not need to fully redraw the website, with great care to handle history correctly and consistently with what would happen with JS disabled.