3 ms·
No mention of the <dialog> element [1] but that's probably because browser support isn't great—not implemented in Safari, experimental flag in Firefox. The laz
by wanda 5y ago
No mention of the <dialog> element [1] but that's probably because browser support isn't great—not implemented in Safari, experimental flag in Firefox.
The lazy-loading option for img elements is news to me, but I think I'd still prefer to use JavaScript for that task. Same probably goes for the dialog element actually now that I think about it.
Having a simple HTML5 option might seem cool, but I like to keep the actual logic in JavaScript and to use HTML just for page structure. Basically, I prefer to depend on HTML as little as possible for user interaction/behaviour.
HTML: what an element *is*
CSS: how an element looks
JS: what an element *does*
There's always overlap and blurred lines but that's one of the joys [2] of developing for the web.
If you're using a framework like React you don't even care about the markup, it's all abstracted away -- but in that case, you care even less about neat little HTML5 additions, you've got components and they're woven into your event dispatch and state already.
[1]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dialog https://developer.mozilla.org/en-US/docs/Web/HTML/Element/di...
[2]: horrors
- afavour 5y agoI’d argue that image lazy loading isn’t really a thing an image does, it’s a browser optimisation for asset loading. The built in functionality ensures the image is loaded well before it appears on the screen.
- Zardoz84 5y ago> No mention of the <dialog> element [1] but that's probably because browser support isn't great—not implemented in Safari, experimental flag in Firefox. There is a polyfill that makes it works even on IE. I embraced and use it on a product that it's remaking&modernizing all the frontend. Sadly, when I take the decision a few years ago, I thought that <dialog> would be supported for all browsers, but looks that adoption has been paralyzed.
- thrwaeasddsaf 5y ago> Basically, I prefer to depend on HTML as little as possible for user interaction/behaviour. I prefer to depend on the user agent for user interaction and behavior. Javascript and all its potential for tracking, malware, side channel exploits, etc. should be abolished from the safe web.