SSE Test Server

This commit is contained in:
Ben Pate 2021-11-15 10:15:15 -07:00
parent 6f9c3c2e03
commit 0e3e61b0ac
3 changed files with 16 additions and 9 deletions

View File

@ -4,13 +4,20 @@
<title>&lt;/&gt; htmx SSE Test Server</title>
<script src="/htmx/htmx.js"></script>
<script src="/htmx/ext/sse.js"></script>
<script src="https://unpkg.com/hyperscript.org@0.8.3"></script>
<script type="text/hyperscript">
on click(target) from <#navigation a/>
log "got it"
take .selected for target
</script>
</head>
<body>
<div id="header"></div>
<div id="navigation" hx-target="#page" hx-push-url="false">
<a href="index.html" hx-boost="false">Home</a>
<a href="" hx-get="sse.html">Simple</a>
<a href="index.html" hx-boost="false">About</a>
<a href="" hx-get="sse-simple.html">Simple</a>
<a href="" hx-get="sse-multichannel.html">Multi-Channel</a>
<a href="" hx-get="sse-triggers.html">Event Trigger</a>
<a href="" hx-get="sse-target.html">Event Target</a>

View File

@ -17,4 +17,4 @@
<div class="container" hx-ext="sse" sse-url="http://localhost/albums.html" sse-swap="message">Waiting for Albums...</div>
<div class="container" hx-ext="sse" sse-url="http://localhost/todos.html" sse-swap="message">Waiting for ToDos...</div>
<div class="container" hx-ext="sse" sse-url="http://localhost/users.html" sse-swap="message">Waiting for Users...</div>
</div>
</div>

View File

@ -47,7 +47,12 @@ body {
padding: 10px;
border: solid 1px gray;
margin-bottom: 20px;
background-color:white;
background-color:#f7f7f7;
}
.container.htmx-settling {
border:solid 3px red!important;
padding:8px!important;
}
pre.code {
@ -59,11 +64,6 @@ pre.code {
display:block;
}
.container.htmx-settling {
border:solid 3px red!important;
padding:8px!important;
}
.bold {
font-weight:bold;
}