htmx/test/manual/poll-clears-on-reinit-test.html
Carson Gross 110dd63e97 two small bug fixes:
* do not use template parsing for full body response content
* clear polling when reprocessing an element to avoid stacking up poll requests

latter fixes https://github.com/bigskysoftware/htmx/issues/1350
2023-04-11 09:32:52 -06:00

28 lines
829 B
HTML

<html lang="en">
<head>
<meta charset="utf-8" />
<title>Test Scroll Behavior</title>
<script src="../../src/htmx.js"></script>
</head>
<body style="padding:20px;font-family: sans-serif">
<script src="../../node_modules/sinon/pkg/sinon.js"></script>
<script src="../../src/htmx.js"></script>
<script src="../util/util.js"></script>
<script>
server = makeServer();
server.autoRespond = true;
server.respondWith("GET", "/more_divs", "<div>More Content</div>");
</script>
<h1>Clicking On Button Should Not Stack Polling</h1>
<button onclick="pollingDiv.setAttribute('foo', Math.random());
htmx.process(pollingDiv)">
Reprocess Div...
</button>
<div id="pollingDiv" hx-trigger="every 1s" hx-get="/more_divs" hx-swap="beforeend">
<div>Initial Content</div>
</div>
<hr/>
</body>
</html>