I have a golang fiber application where the web page frontend client use htmx. I am…
- User
I have a golang fiber application where the web page frontend client use htmx. I am working on making the web page event driven so that the server endpoints return hx-trigger(s) events back to the client.
Here is a webpage snippet:
I know I can return "HX_Trigger"="someTrigger" in the response header, but I am looking for a more dynamic approach.
Can I respond with a json that the listening htmx element "results" can parse and act on?
I do not want any more javascript than htmx in the browser clinet. I am looking for a way for htmx elements that listen for events to receive and parse a response json from my golang fiber endpoint.
- Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.