summaryrefslogtreecommitdiffstatshomepage
path: root/test/manual/poll-condition-test.html
blob: 38d7fd02c010050c46fa7c49fd54878ce2fc1904 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<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>Should Not Add Any Content Due To False Condition</h1>
<div hx-trigger="every 3s [false]" hx-get="/more_divs" hx-swap="beforeend" style="height: 100px; overflow: scroll">
    No Polling....
</div>
<hr/>
<h1>Should Add Content Due To True Condition</h1>
<div hx-trigger="every 3s [true]" hx-get="/more_divs" hx-swap="beforeend" style="height: 100px; overflow: scroll">
    No Polling....
</div>
<hr/>

</body>
</html>