2 ms·
> it is a small js library ... This means that in theory you don't need js I assume I'm not the only person left a little puzzled. Do you mean "don't need JS"
by rkomorn 10mo ago
> it is a small js library ...
This means that in theory you don't need js
I assume I'm not the only person left a little puzzled.
Do you mean "don't need JS" as in like, a full-fledged JS framework?
- lunar_mycroft 10mo agoThey mean that you don't need to write JS, you can just add a script tag to your page
- ndr 10mo agoSee the quickstart from htmx.org <script src="https://cdn.jsdelivr.net/npm/htmx.org@2.0.8/dist/htmx.min.js"></script> <!-- have a button POST a click via AJAX --> <button hx-post="/clicked" hx-swap="outerHTML"> Click Me </button> When the user clicks the button the browser will take the result of the request to `/clicked` and swap the whole button dom node for whatever the server sent. As a dev you get to write HTML, and need to learn about some new tag attributes. Your browser is still running js.
- chamomeal 10mo agoSorry I know other people have responded already, but it means you don't have to write any client side javascript at all. You can just skip along with a server that returns html. Just throw the script tag in there, and you're done. The magic of this is that it's pretty easy to make SPA-like webapps with no javascript or complex client side framework. You can write your server in python, rust, clojure, whatever. If you don't need a lot of state management, it's really simple and awesome.