mysterious-toddler-20573
02/06/2023, 2:19 AMmysterious-toddler-20573
02/06/2023, 2:19 AMmysterious-toddler-20573
02/06/2023, 2:19 AMmysterious-toddler-20573
02/06/2023, 2:19 AMmysterious-toddler-20573
02/06/2023, 2:19 AMmysterious-toddler-20573
02/06/2023, 2:20 AMprehistoric-garden-45720
02/06/2023, 2:40 AM<template>
tag is something I tried yesterday as I was trying to understand and debug the behavior in htmx.js
. Not really knowing Javascript and not being familiar with the DOM and everything around it didn't help me much. 😄 But it's OK, my local modifications to the inlineSwap
function seem to work just fine for my use case and haven't broken anything I use so far that I can see, so if they're not appropriate changes for the main repo, I don't mind using my modified htmx.js
copy for my website until HTMX 2 comes along.broad-elephant-10716
02/06/2023, 5:32 AM{
"userId": 1,
"id": 1,
"title": "delectus aut autem",
"completed": false
}
And mine looks like:
[{"@row.id":426,"Holiday Text":"National Foundation Day"}]
The difference is the [] around mine, I think, and referencing {{Holiday Text}}
is not working. Is there a strategy for handling json like what I have, perhaps a kind of "jq" filter?ripe-action-67367
02/06/2023, 6:46 AMripe-action-67367
02/06/2023, 6:48 AMripe-action-67367
02/06/2023, 6:55 AM{{#.}} ... {{/.}}
and you should be good to gobroad-elephant-10716
02/06/2023, 7:58 AMmicroscopic-art-61410
02/06/2023, 9:11 AMgray-dinner-25100
02/06/2023, 6:13 PMmysterious-toddler-20573
02/06/2023, 6:28 PMmysterious-toddler-20573
02/06/2023, 6:29 PMlate-king-98305
02/06/2023, 8:48 PMlate-king-98305
02/06/2023, 8:58 PMlimited-potato-46306
02/06/2023, 11:12 PMfetch(presignedPutURL, { method: 'PUT', body: e.target.files[0]});
I tried following the example docs for file uploads (https://htmx.org/examples/file-upload/), with and without hx-encoding, but no dice (also the example uses hx-post).little-kilobyte-16316
02/07/2023, 12:28 AMmysterious-toddler-20573
02/07/2023, 1:56 AMlittle-kilobyte-16316
02/07/2023, 4:54 AMripe-action-67367
02/07/2023, 7:24 AMmultipart/form-data
uploading protocol, so I would consider looking at that first https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-post-example.html. It's a bit more complicated, compared to simple PUT, but it should work with htmx without jumping through the hoops. As for using PUT with htmx, you most likely would have to modify request body with JS by listening to htmx:configRequest and similar events, since htmx always uses either x-www-form-urlencoded or multipart/formdata (or JSON, if you use an extension)
\_hyperscript on the other hand would do this very easily
_='on submit
halt the event
fetch presignedUrl with method:"PUT", body:#file-0.files[0]'
clever-activity-24633
02/07/2023, 10:36 AMshy-napkin-38132
02/07/2023, 5:58 PMripe-action-67367
02/07/2023, 5:59 PMgreat-gold-37694
02/07/2023, 10:36 PMgreat-gold-37694
02/07/2023, 10:36 PMripe-action-67367
02/07/2023, 10:42 PM