sparse-cat-39392
04/04/2022, 7:44 PMwhite-motorcycle-95262
04/04/2022, 8:31 PMmysterious-toddler-20573
04/04/2022, 8:38 PMmysterious-toddler-20573
04/04/2022, 8:38 PMmysterious-toddler-20573
04/04/2022, 8:38 PMbreezy-dinner-74199
04/05/2022, 2:48 AMdetails.elt is the element that dispatched the event, but it seems like it's the node added to the DOM? are the docs right?breezy-dinner-74199
04/05/2022, 2:50 AMhtmx:beforeOnLoad but how do I access the dom node returned from the server? Do I need to parse the detail.xhr.response ?mysterious-toddler-20573
04/05/2022, 3:16 AMmysterious-toddler-20573
04/05/2022, 3:17 AMtransformResponse extension point: https://htmx.org/extensions/#definingbreezy-dinner-74199
04/05/2022, 3:18 AMDomParser.parseFromString to be able to query the dom yeah? The elt passed into that function is the triggering dom item, not the response dom item.mysterious-toddler-20573
04/05/2022, 3:19 AMearly-australia-38728
04/05/2022, 4:02 AMafterend (or whatever) somewhere?breezy-dinner-74199
04/05/2022, 6:28 AMbreezy-dinner-74199
04/05/2022, 6:31 AMsparse-cat-39392
04/05/2022, 7:01 AMbreezy-dinner-74199
04/05/2022, 7:43 AMbetter-market-46333
04/05/2022, 10:52 AMbetter-market-46333
04/05/2022, 10:52 AMsparse-school-20034
04/05/2022, 12:42 PMsparse-school-20034
04/05/2022, 12:46 PMmysterious-toddler-20573
04/05/2022, 1:26 PMmysterious-toddler-20573
04/05/2022, 1:27 PMmysterious-toddler-20573
04/05/2022, 1:28 PMHX-Trigger headers?mysterious-toddler-20573
04/05/2022, 1:28 PMmysterious-toddler-20573
04/05/2022, 1:29 PMmysterious-toddler-20573
04/05/2022, 2:40 PMmysterious-toddler-20573
04/05/2022, 2:41 PMbreezy-dinner-74199
04/05/2022, 2:43 PMtransformResponse and modifying the html text is the way to go then. We can get it working listening to the htmx:beforeProcessNode event but I think that is just because (I guess) eval of scripts does not occur at that point, giving us time to put the script/css tags into the dom - and the elt is the new dom node, not the triggering node (as the docs are wrong)
Would you say using transformResponse is recommended way though?mysterious-toddler-20573
04/05/2022, 2:43 PMnpm install and start a webserver in that directory. here is python script to do so:
python
import SimpleHTTPServer
import SocketServer
PORT = 8088
Handler = SimpleHTTPServer.SimpleHTTPRequestHandler
httpd = SocketServer.TCPServer(("", PORT), Handler)
print "serving at port", PORT
httpd.serve_forever()mysterious-toddler-20573
04/05/2022, 2:44 PM