Skip to content

Error handling for htmx.ajax() #926

Answered by gapop
gapop asked this question in Q&A
Discussion options

You must be logged in to vote

In case someone else needs this: pass the handler callback in the context parameter of the .ajax() method. This callback should take a parameter, let’s call it response, and look for response['htmx-internal-data'].xhr.status.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Renerick
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant