5 ms·
I kind of hoped the long term result of htmx, instead of just being a Javascript library, was to become a standard in a newer version of HTML itself. The constr
by rprenger 3y ago
I kind of hoped the long term result of htmx, instead of just being a Javascript library, was to become a standard in a newer version of HTML itself. The constraints of only forms being able to do POSTs, and the only way to handle the response is to rewrite the entire page seems arbitrarily limiting. If htmx were just HTML6 or whatever, it'd outlive all the Javascript frameworks.
- buildbot 3y agoI literally just started with htmx, but can’t you override both of those behaviors? hx-<http verb> on the form will switch the verb it uses, and you can swap outerhtml, innerhtml, or some other css target? Or am I incorrect?
- candiddevmike 3y agoYou'd have to merge JavaScript and HTML to get htmx in any usage capacity. HTML is not a programming language, it's a markup language.
- mjburgess 3y agoaccording to the people who write standards, but not the people who write browsers
- recursivedoubts 3y agoI have thrown together a minimalist extension to HTML that I think captures the core ideas of htmx, although you are right that there are still some outstanding issues that probably need additional thinking to make it widely useful: https://gist.github.com/1cg/d1ad1ddd5f43a8a993cd9f711135edc9 https://gist.github.com/1cg/d1ad1ddd5f43a8a993cd9f711135edc9 Here is an example button using these proposed extensions to HTML <button href="/example" method="patch" target="#divToReplace" onClick="this.submit()"> This is an example button hypermedia control </button>
- candiddevmike 3y agoSo you want to inline JavaScript, similar to CSS and the `style` attribute?
- recursivedoubts 3y agoI would prefer something more like what htmx has in hx-trigger: https://htmx.org/attributes/hx-trigger/ https://htmx.org/attributes/hx-trigger/ w/ an explicit and declarative syntax, but that attribute is fairly involved this was a brief exercise in thinking about the minimal changes necessary to HTML to support something like htmx, and unfortunately there isn't any attribute that maps to hx-trigger in the same way there is for other htmx attributes, so I resorted to the on* attributes + generalizing the submit() function on forms.
- Spivak 3y agoYes and no. You wouldn't call a <form> inlining JS while it does come with some degree of interaction. It would be an expansion of HTML to include a few new things to (ideally) enable a wider rage of lightly-interactive websites to be HTML only.
- flir 3y agoI'd vote for being able to put an href attribute on any element (eg <div href=""> and <span href="">), and maybe binning <a> entirely. That seems like such an obvious enhancement to me, I figure there's probably a deep reason it hasn't been done.
- deleted 3y ago[deleted]
- GenerocUsername 3y agoI think this is still possible. It took a decade for JQuery to be nearly completely absorbed by browser standards.
- candiddevmike 3y agoFor the most part, jQuery was absorbed into ES/JavaScript, not HTML.
- jitl 3y agoThe most visible part of jQuery for me was always querying selectors - $('.some > a.selector'); and that certainly was something integrated into HTML/the DOM as document.querySelectorAll('.some > a.selector').
- nkozyra 3y agoWell yeah, that's still under "browser standards."
- weo3dev 3y agoThe difference is that the internet can exist (and did) quite well without JavaScript. Without HTML there is no internet. Furthermore, ECMAScript is a language and W3C/WHATWG are a consortium that maintain HTML.
- Gud 3y agoSorry to nitpick, but there is a lot more to the internet than the web.
- troupo 3y agoAnd the browser APIs still have significantly worse ergonomics than jQuery
- deleted 3y ago[deleted]
- meiraleal 3y ago> The constraints of only forms being able to do POSTs HTML elements shouldn't do POSTs, that's why JavaScript exists. <form> and <a> are elements that do HTTP requests but the same can be added to any other html or custom element. html integration with JS doesn't need another layer.