Hacker News new | ask | show | jobs
by falsandtru 894 days ago
An example on the top page shows that this is an operation that should be written as a program. Therefore, this is not markup. Syntax that is not markup will not be the HTML specification.

> <button hx-post="/clicked" hx-swap="outerHTML">

2 comments

How is that different than a standard <a> or <form> element that submits an HTTP request, receives some HTML in response, and uses that HTML to render a new GUI?
The point of HTMX is that any element can submit HTTP requests, and you can drop the response anywhere in the document. It no longer has to be just <a> and <form> with full page reloads.
Yes. That’s the point? So why is it egregious in a way that <form> is not?
It's not different. The question is if we would have current JS capabilities in the past would we choose adding handling of <form> to HTML or would we say use JS for that. I am not sure what is the right answer but adding features to both sides is probably not a great idea because you just bloat everything.
It's a language paradigm thing. You can implement anything, from HTML to CSS, in pure imperative JS, but the result would be extremely verbose and virtually impossible for machines to interpret on the fly (i.e. little accessibility support).

There is concrete value in stating unambiguously "this is a <form>" versus "this is a blob of imperative code that I swear acts like a <form>".

"should" is doing a lot of work in that sentence

how do you feel about the href, method and action attributes in HTML?