Skip to content
Discussion options

You must be logged in to vote

Hey, indeed when constructing a XMLHttpRequest yourself, htmx will simply not know about it as it was never called during the process, and will not be able to process its response. There's no magic involved here; all the htmx response handling usually happens because htmx itself made the request!

If you're interested in handling this request's response like a usual htmx request, then you will likely want to use the JS API, specifically the htmx.ajax method, that lets you make a request with whatever method / params / body you want, while triggering all htmx logic along that you would expect

Hope this helps!

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@anorman1967
Comment options

@anorman1967
Comment options

Answer selected by anorman1967
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants