💭 htmx ~ The response-targets Extension =========================================== !https://htmx.org/extensions/response-targets/ Date: April 30, 2024 htmx ~ The htmx Response Targets Extension Extension htmx gives you access to AJAX, CSS Transitions, WebSockets and Server Sent Events directly in HTML, using attributes, so you can build modern user interfaces with the simplicity and power of hypert... htmx.org [1] The htmx response-targets extension allows me to respond to errors from the backend and do normal htmx swaps. > !!! note by default htmx will only swap on 200 and 300 responses Load the extension in head ``` html ``` Use the extension on an endpoint that might return a 400. ``` html Register! ``` !!! note This post is a thought [2]. It's a short note that I make about someone else's content online #thoughts [3] References: [1]: https://htmx.org/extensions/response-targets/ [2]: /thoughts/ [3]: /tags/thoughts/