Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

There is no point of introducing yet another standard to do something that can be done in few lines of JS.

   customElements.define(
     "html-include",
     class extends HTMLElement {
       connectedCallback() {
         fetch(this.getAttribute("href"))
           .then((response) => response.text())
           .then((text) => (this.innerHTML = text))}});

The browser has had a powerful scripting language built in as a core primitive for decades, and yet people would rather create more standards to avoid using it for ideological reasons, and then complain that there aren't enough competing browsers.


That’s not nearly as nice as being able to drop a…

   <include src="/shared/header.htmp”>
…in anywhere you want a header. It being part of HTML also allows engines to optimize in ways that otherwise wouldn’t be possible and implement user-toggleable features like lazy loading. It can get better as browsers get better and is less likely to break than any custom JS I write.


We should drop HTML and CSS files as well, because you can just use JS to create DOM nodes and set styles on them.


One of the greatest features of pdf is that js support is unreliable.


It's something that people keep reinventing on both sides of the connection. That XSLT is the better of two terrible ways to do it, and that you're making the argument that the other one still exists, is an embarrassment.


The point is to take JS implemented features and make them native to the browser.


That's a terrible point.


Not at all. The existence of general purpose scripting isn't and shouldn’t be at odds with equipping HTML to handle a few very common, very basic tasks without JS. There’s plenty to be gained by doing so, including better ergonomics and efficiency. Even heavy JS apps stand to benefit since it’s that much less code to have to write and maintain.


> yet people would rather create more standards to avoid using it for ideological reasons

Uh the standard in question has existed for over two decades




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: