mirror of
https://github.com/bigskysoftware/htmx.git
synced 2025-09-28 05:21:18 +00:00
41 lines
1.1 KiB
HTML
41 lines
1.1 KiB
HTML
<html>
|
|
<head>
|
|
<script src="../../src/htmx.js"></script>
|
|
<script>
|
|
htmx.createEventSource = function(url){
|
|
return new EventSource(url, {withCredentials:false})
|
|
}
|
|
</script>
|
|
<style>
|
|
*{
|
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
|
|
}
|
|
|
|
body {
|
|
background-color: #eeeeee;
|
|
}
|
|
|
|
.container {
|
|
padding: 10px;
|
|
border: solid 1px gray;
|
|
margin-bottom: 20px;
|
|
background-color:white;
|
|
}
|
|
|
|
.bold {
|
|
font-weight:bold;
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<div id="page" hx-sse="connect:http://sseplaceholder.openfollow.org/posts.html?types=Event1%2cEvent2%2cEvent3%2cEvent4">
|
|
<h3>Multiple Listeners. message only</h3>
|
|
<div class="container" hx-sse="swap:Event1">Waiting for Posts in Event1 channel...</div>
|
|
<div class="container" hx-sse="swap:Event2">Waiting for Posts in Event2 channel...</div>
|
|
<div class="container" hx-sse="swap:Event3">Waiting for Posts in Event3 channel...</div>
|
|
<div class="container" hx-sse="swap:Event4">Waiting for Posts in Event4 channel...</div>
|
|
</div>
|
|
</body>
|
|
</html> |