Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
m4lvin
on Dec 14, 2022
|
parent
|
context
|
favorite
| on:
Htmx in a Nutshell
How does error handling work? If I try to replace the content of some div with a reply I get using htmx, but the request fails or times out etc., what content is then put into the div? What if the reply is not valid HTML?
Sorry for the newb and lazy questions.
recursivedoubts
on Dec 14, 2022
|
next
[–]
htmx doesn't do anything on an error by default, but you can override this behavior using the extensive event system it has:
https://htmx.org/events/#htmx:responseError
silver-arrow
on Dec 14, 2022
|
prev
[–]
It’s pretty simple to use the htmx events on the Response to handle errors dialogs or other behavior
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search:
Sorry for the newb and lazy questions.