big-airline-13935
01/06/2021, 8:26 AMquaint-pizza-22478
01/06/2021, 10:14 AMbig-airline-13935
01/06/2021, 11:44 AMbig-airline-13935
01/06/2021, 11:46 AMquaint-pizza-22478
01/06/2021, 11:53 AMbig-airline-13935
01/06/2021, 12:10 PMbig-airline-13935
01/06/2021, 1:11 PMmysterious-toddler-20573
01/06/2021, 1:37 PMmysterious-toddler-20573
01/06/2021, 1:38 PMmysterious-toddler-20573
01/06/2021, 1:40 PMmysterious-toddler-20573
01/06/2021, 2:09 PMbig-airline-13935
01/06/2021, 4:06 PMadamant-exabyte-92636
01/06/2021, 11:10 PMIntercooler.ready and htmx.onLoad ... in the Intercooler case the element being passed in is the root element whose content is being swapped (e.g. body). With htmx the element is the content being swapped itself, correct (if using the default innerHTML swapping strategy)? If so, what would the best approach be to replicate the "get root element being swapped" with htmx?mysterious-toddler-20573
01/06/2021, 11:13 PMadamant-exabyte-92636
01/06/2021, 11:15 PMadamant-exabyte-92636
01/06/2021, 11:26 PMadamant-exabyte-92636
01/06/2021, 11:26 PM<body>
<div id="nav" hx-boost="true" hx-target="#main">
<ul>
<li><a href="/path"></li>
</ul>
</div
<div id="main"></div>
</body>
<script>
Intercooler.ready(function(rootContent) {
init(rootContent);
});
<script>adamant-exabyte-92636
01/06/2021, 11:27 PM<li><a href="/path"></li>mysterious-toddler-20573
01/06/2021, 11:28 PMadamant-exabyte-92636
01/06/2021, 11:28 PMrootContent element passed to the Intercooler.ready callback, would be <div id="main">, right?adamant-exabyte-92636
01/06/2021, 11:28 PMIntercooler.ready handler with:adamant-exabyte-92636
01/06/2021, 11:29 PMhtmx.onLoad(function(elt)) {
init(elt);
}mysterious-toddler-20573
01/06/2021, 11:29 PMmysterious-toddler-20573
01/06/2021, 11:29 PMadamant-exabyte-92636
01/06/2021, 11:30 PMelt will not be <div id="main">, right?mysterious-toddler-20573
01/06/2021, 11:30 PMmysterious-toddler-20573
01/06/2021, 11:30 PMmysterious-toddler-20573
01/06/2021, 11:30 PMadamant-exabyte-92636
01/06/2021, 11:30 PMadamant-exabyte-92636
01/06/2021, 11:31 PM<div id="main"> in the htmx case, so I can initialise event handlers and stuff on it. Possible?