miniature-controller-37356
01/07/2022, 3:02 PM<div>
<a hx-get="/endpoint" hx-target="p.success">Click me</a>
<h5>Title 1</h5>
<p class="success">No information</p>
</div>
<div>
<a hx-get="/endpoint2" hx-target="p.success">Click me</a>
<h5>Title 2</h5>
<p class="success">No information</p>
</div>
Thanks!tall-cat-32859
01/07/2022, 3:15 PMred-tailor-33123
01/07/2022, 5:41 PMmysterious-toddler-20573
01/07/2022, 5:58 PMred-tailor-33123
01/07/2022, 6:11 PMminiature-controller-37356
01/07/2022, 7:36 PMminiature-controller-37356
01/07/2022, 7:39 PM<div>
<a hx-get="/endpoint" hx-trigger="click, then every 5s (for 120s)" hx-target="p.success">Click me</a>
<h5>Title 1</h5>
<p class="success">No information</p>
</div>mysterious-toddler-20573
01/07/2022, 7:51 PMmysterious-toddler-20573
01/07/2022, 7:51 PMmysterious-toddler-20573
01/07/2022, 7:53 PMhtml
<div>
<a hx-get="/endpoint" hx-trigger="request" hx-target="p.success"
_="on click trigger request
repeat 24 times
wait 5s then trigger request">Click me</a>
<h5>Title 1</h5>
<p class="success">No information</p>
</div>mysterious-toddler-20573
01/07/2022, 7:54 PMmysterious-toddler-20573
01/07/2022, 7:54 PMmysterious-toddler-20573
01/07/2022, 10:27 PMhtml
<div>
<a hx-get="/endpoint" hx-trigger="request" hx-target="p.success"
_="on click trigger request
add @disabled
repeat 24 times
wait 5s then trigger request
end
remove @disabled">Click me</a>
<h5>Title 1</h5>
<p class="success">No information</p>
</div>mysterious-toddler-20573
01/07/2022, 10:28 PMbreezy-river-76423
01/07/2022, 11:04 PMhx-boost to display the response HTML for responses with a 500 status code?
Edit: I just found this comment in the source explaining that I can listen on htmx:beforeSwap and set `shouldSwap`: https://github.com/bigskysoftware/htmx/blob/master/src/htmx.js#L2501-L2504
I wonder if this is a common use case though, where I really just want to use HTMX as an enhancement on an app that's always going to respond with full-page HTML views.hundreds-camera-24900
01/07/2022, 11:34 PMhundreds-camera-24900
01/07/2022, 11:34 PMhundreds-camera-24900
01/07/2022, 11:35 PMhundreds-camera-24900
01/07/2022, 11:35 PMmysterious-toddler-20573
01/07/2022, 11:45 PMhtml
<div>
<a hx-get="/endpoint"
hx-trigger="request"
hx-target="p.success"
_="on click trigger request
show the next <button/>
add @disabled
repeat 24 times
wait for a cancel or 5s
if the result's type is 'cancel'
break
otherwise
trigger request
end
end
hide the next <button/>
remove @disabled">Click me</a>
<button style="display:none"
_="on click send cancel to the previous <a/>">
Cancel
</button>
<h5>Title 1</h5>
<p class="success">No information</p>
</div>mysterious-toddler-20573
01/07/2022, 11:46 PMmysterious-toddler-20573
01/07/2022, 11:51 PMmysterious-toddler-20573
01/08/2022, 12:04 AMbreak yet, just continue will need to rework (making a jsfiddle)mysterious-toddler-20573
01/08/2022, 12:45 AMwait command, fixed locallymysterious-toddler-20573
01/08/2022, 12:45 AMgorgeous-ghost-95789
01/08/2022, 12:46 AMmysterious-toddler-20573
01/08/2022, 12:49 AMmysterious-toddler-20573
01/08/2022, 12:55 AMmysterious-toddler-20573
01/08/2022, 2:00 AMnarrow-evening-29329
01/08/2022, 2:44 AM