Hacker News new | past | comments | ask | show | jobs | submit login

I haven't looked into htmx much yet, but am using its predecessor intercooler-js, and this is my code for handling server responses and displaying an error message when it's needed: https://gitlab.com/tildes/tildes/-/blob/master/tildes/static...

I wouldn't consider it particularly elegant, but it's straightforward and has worked well. It uses the "complete.ic" event to trigger whenever an intercooler request finishes, and then uses the response status/code/text to display an appropriate message.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: