3 ms·
Hi There. For 1, you probably want to either trigger js events using the various `HX-Trigger*` headers: https://htmx.org/reference/#response_headers https://ht
by recursivedoubts 5y ago
Hi There.
For 1, you probably want to either trigger js events using the various `HX-Trigger*` headers: https://htmx.org/reference/#response_headers https://htmx.org/reference/#response_headers or consider creating a small extension based on the client-side templates extension: https://htmx.org/extensions/client-side-templates/ https://htmx.org/extensions/client-side-templates/
For 2, I think this was a classic tone-on-the-internet issue. The 7b rule is mainly a joke/meme where we (the htmx discord) tell old-timers who want something "Hey, great idea. Now you have to implement it." For a newbie this might come across as "f you, u fix it" but that's not the underlying message.
We are happy to take feature requests and do try to implement them (e.g. I just added request synchronization via the `hx-sync` attribute in 1.7.0, based on a user request: https://htmx.org/attributes/hx-sync/ https://htmx.org/attributes/hx-sync/)
That said, the htmx code base is relatively small and simple to deal with, and I do highly encourage people to dig in and see if they can fix their issues or, especially, add the functionality with an extension. I want the code to be truly a public good: BSD, anyone can read and understand it, we don't thrash the code base around a lot.
- sam_goody 5y agoFirstly, thank you for your response. This is not really the forum for this, but for 1, I don't see how this will help. I get a response from the server of <li>1</li><li>5</li>, and I want to add [1,5] to an array, and then modify them to <li>one</li><li>five</li> before insertion. How would I do that? 2. Lack of internet meme knowledge, but still perhaps worth thinking about changing?
- recursivedoubts 5y agoFor 1, you would probably want to follow the code here for client side templates: https://unpkg.com/htmx.org@1.7.0/dist/ext/client-side-templates.js https://unpkg.com/htmx.org@1.7.0/dist/ext/client-side-templa... in particular taking advantage of the `transformResponse` extension point in htmx. It would not be too much work to allow a function call to transform and extract information from the `text` variable, which is the raw response text. For 2, I have updated the FAQ to make it clear that it's a joke.