5 ms·
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 no
by falsandtru 3y 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">
- pphysch 3y agoHow 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?
- hellcow 3y agoThe 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.
- cqqxo4zV46cp 3y agoYes. That’s the point? So why is it egregious in a way that <form> is not?
- omnimus 3y agoIt'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.
- pphysch 3y agoIt'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>".
- recursivedoubts 3y ago"should" is doing a lot of work in that sentence how do you feel about the href, method and action attributes in HTML?