4 ms·
regardless of what CSS query you use to look the element up, in the jquery example you'd still have your logic (the url, etc) defined elsewhere the htmx versio
by recursivedoubts 2y ago
regardless of what CSS query you use to look the element up, in the jquery example you'd still have your logic (the url, etc) defined elsewhere
the htmx version is symmetric with the href attribute in that it completely specifies what is going to happen directly on the element itself
of course you could do something in jquery like using a data attribute to store the url and HTTP method, etc, but at that point you'd be building https://intercoolerjs.org https://intercoolerjs.org, the predecessor to htmx that was built on top of jquery
- ndriscoll 2y agoThe htmx also has the logic defined elsewhere. It's literally exactly the same html.
- recursivedoubts 2y agowith an anchor tag's href attribute, is the logic defined elsewhere?
- ndriscoll 2y agoIf you're being consistent, yes. The DTD specifies that you should refer elsewhere for the semantics, just as <button hx-get="/clicked"> has semantics that depend on whether you say "this is htmx" or "this is X library based on jQuery". Or alternatively those things all exactly specify the behavior, and you can go look at their specification for the details.
- recursivedoubts 2y agofantastic I think the idea of locality of behavior is one that will not make sense to you
- ndriscoll 2y agoTo the extent that it depends not on the code or its behavior, but on the interpreter that runs it, I suppose so. If you write the exact same code with the exact same meaning, I'm not sure why it matters.
- recursivedoubts 2y agoexactly