steep-france-23568
03/01/2022, 10:29 PMclean-holiday-8914
03/02/2022, 2:22 PM<button hx-post="/close" hx-trigger="click"> Test </button>clean-holiday-8914
03/02/2022, 2:25 PMlet button = document.createElement("button");
div.appendChild(button)
button.setAttribute("hx-post", "/close")
button.setAttribute("hx-trigger", "click")
button.textContent = "Test"clean-holiday-8914
03/02/2022, 2:27 PMsalmon-xylophone-28580
03/02/2022, 2:33 PMhundreds-camera-24900
03/02/2022, 2:37 PMhundreds-camera-24900
03/02/2022, 2:37 PMclean-holiday-8914
03/02/2022, 2:39 PMadamant-exabyte-92636
03/02/2022, 5:15 PMmysterious-toddler-20573
03/02/2022, 5:17 PMgorgeous-airport-54386
03/02/2022, 5:17 PMhttps://https://big-airline-13935
03/02/2022, 5:55 PMadventurous-account-56062
03/02/2022, 10:44 PMadventurous-account-56062
03/02/2022, 10:50 PMcalm-ice-23682
03/03/2022, 12:44 PMmost-jelly-15242
03/03/2022, 12:50 PMcalm-ice-23682
03/03/2022, 12:53 PMcalm-ice-23682
03/03/2022, 12:55 PMmysterious-toddler-20573
03/03/2022, 1:00 PMmysterious-toddler-20573
03/03/2022, 1:00 PMmysterious-toddler-20573
03/03/2022, 1:00 PMhundreds-camera-24900
03/03/2022, 2:08 PMpowerful-evening-99811
03/03/2022, 4:18 PMgorgeous-ghost-95789
03/03/2022, 5:31 PMhx-get that changes the underlying page, you can close the SSE.
I use this on my CMS. Most pages maintain an SSE connection to the server to subscribe to updates about that particular page. But when you navigate away, the original connection is removed and a new one is created to receive updates for the new page.narrow-evening-29329
03/03/2022, 7:46 PMmysterious-toddler-20573
03/03/2022, 7:49 PMmysterious-toddler-20573
03/03/2022, 7:49 PMnarrow-evening-29329
03/03/2022, 7:49 PMstocky-mechanic-87541
03/03/2022, 8:29 PMthousands-belgium-91006
03/03/2022, 9:50 PM