bright-postman-22230
05/24/2022, 2:43 PM<button hx-post="/clicked"
hx-trigger="click"
hx-target="#parent-div"
hx-swap="outerHTML"
>Click Me!</button>
/clicked returns foo immediately, and after a second bar. i would like the foo to show up immediately in #parent-div
Is there a way to achieve this?bright-postman-22230
05/24/2022, 2:54 PMproud-librarian-99598
05/24/2022, 3:01 PMmysterious-toddler-20573
05/24/2022, 3:12 PMmysterious-toddler-20573
05/24/2022, 3:12 PMmysterious-toddler-20573
05/24/2022, 3:13 PMlittle-journalist-53964
05/24/2022, 3:30 PMbright-postman-22230
05/24/2022, 3:55 PMmysterious-toddler-20573
05/24/2022, 6:20 PMicy-planet-32950
05/24/2022, 6:30 PMHX-Redirect
Requests sent as a result of HX-Redirect obviously have the Hx-Request header set. I need my backend to be able to distinguish between the two. So I'd like to set a header that is something like Hx-Redirected to 'true' for those requests.
From what I could tell, this is what handles the redirect:
if (hasHeader(xhr, /HX-Redirect:/i)) {
window.location.href = xhr.getResponseHeader("HX-Redirect");
return;
}
What's weird though is that I don't see it setting the Hx-Request header anywhere. In fact, I didn't even know that was possible for window.location.href but when I look at my request headers, it's definitely got Hx-Request set.gorgeous-airport-54386
05/24/2022, 6:38 PMmysterious-toddler-20573
05/24/2022, 6:41 PMmysterious-toddler-20573
05/24/2022, 6:43 PMicy-planet-32950
05/24/2022, 8:13 PMicy-planet-32950
05/24/2022, 8:14 PMicy-planet-32950
05/24/2022, 8:14 PMbright-postman-22230
05/24/2022, 8:26 PMgorgeous-ghost-95789
05/24/2022, 8:54 PMgorgeous-ghost-95789
05/24/2022, 8:55 PMlate-king-98305
05/25/2022, 12:14 AMcalm-queen-64495
05/25/2022, 2:06 AMlate-king-98305
05/25/2022, 2:18 AMcalm-queen-64495
05/25/2022, 3:38 AMhappy-knife-63802
05/25/2022, 7:01 AMripe-action-67367
05/25/2022, 8:21 AMrefined-waiter-90422
05/25/2022, 11:23 AMmysterious-toddler-20573
05/25/2022, 11:24 AMripe-action-67367
05/25/2022, 11:43 AMlittle-greece-16394
05/25/2022, 1:32 PMhx-boost="true" to render 404 pages as well?