careful-room-54859
02/09/2022, 1:13 AMlate-king-98305
02/09/2022, 1:35 AMhx-boost on a div with links generated by ASP.NET MVC's tag helpers? I think, by the time the page renders, the `href`s should be set (i.e., before the htmx script loads). I'm working on a prototype (non-public network, sadly). I haven't dug hardly at all; I just thought I'd ask the high-powered developers here if they'd ever run into that scenario.late-king-98305
02/09/2022, 1:36 AM<div hx-boost hx-target="main">
<a asp-controller="Home" asp-action="Index">Home</a>
</div>
renders as
<div hx-boost hx-target="main">
<a href="/">Home</a>
</div>mysterious-toddler-20573
02/09/2022, 1:39 AMcareful-room-54859
02/09/2022, 1:42 AMmysterious-toddler-20573
02/09/2022, 1:42 AMmysterious-toddler-20573
02/09/2022, 1:43 AMmysterious-toddler-20573
02/09/2022, 1:43 AMmysterious-toddler-20573
02/09/2022, 1:43 AMmysterious-toddler-20573
02/09/2022, 1:43 AMjavascript
function processNode(elt) {
elt = resolveTarget(elt);
initNode(elt);
forEach(findElementsToProcess(elt), function(child) { initNode(child) });
}mysterious-toddler-20573
02/09/2022, 1:43 AMhx- attributes on themmysterious-toddler-20573
02/09/2022, 1:44 AMmysterious-toddler-20573
02/09/2022, 1:44 AMcareful-room-54859
02/09/2022, 1:44 AMmysterious-toddler-20573
02/09/2022, 1:45 AMcareful-room-54859
02/09/2022, 1:45 AMmysterious-toddler-20573
02/09/2022, 1:45 AMmysterious-toddler-20573
02/09/2022, 1:45 AMcareful-room-54859
02/09/2022, 1:54 AMcareful-room-54859
02/09/2022, 1:55 AMhtml
<script src="https://raw.githubusercontent.com/bigskysoftware/htmx/master/src/htmx.js"></script>careful-room-54859
02/09/2022, 2:29 AMhtmx.process(...) it goes into the initNode for my FORM but it skips it as it has already been initialized. I tried to force it false but that didn't change anything. I also saw that the getInternalData(elt) call already returned the path but this is the old one.....careful-room-54859
02/09/2022, 2:45 AMhtmx-internal-data.path to my updated URL but it still does not honor it. You can see that it is updated as follows:careful-room-54859
02/09/2022, 2:46 AMcareful-room-54859
02/09/2022, 2:47 AMhx-post use the internal-data's path when executing? I am updating both now but still to no avail.....careful-room-54859
02/09/2022, 2:49 AMjavascript
let post = el.getAttribute('hx-post');
let path = location.pathname;
let url = `${post}?redirect_url='${path}'`;
el.setAttribute('hx-post', url);
el.dataset.processed = true;
if (el['htmx-internal-data']) {
el['htmx-internal-data'].path = url;
}
htmx.process(el.parentElement);red-farmer-97020
02/09/2022, 4:59 AMstocky-dentist-80693
02/09/2022, 8:11 AMlate-king-98305
02/09/2022, 6:18 PMhx-boost not boosting? I've tried it on an owning element, directly on an a tag, and I've called htmx.process on the owning element; none of that has worked. Putting an explicit hx-get on the anchor tag does result in an htmx-initiated request, but that's not really what I'm trying to make happen. I'm sure it's something dumb on my part...gifted-airline-5816
02/09/2022, 6:29 PMlate-king-98305
02/09/2022, 7:27 PMa tag with an hx-get and an href follows the href - the browser loads it, not htmx.