mirror of
https://github.com/bigskysoftware/htmx.git
synced 2026-03-11 08:29:08 +00:00
* Write WS and SSE test backend in node * Refactor pages so that the URLs work * Add tab highlighting script * Fix stream with multiple events * Fix highlighting on ext links * Refactor WS code * Support event trigger tests * Add some jitter to the intervals * Delete old go backend * Update README with new info and credits * Update top-level README * Move ws to dev dependencies * Remove extraneous go server * Fix misplace comment
42 lines
1.1 KiB
HTML
42 lines
1.1 KiB
HTML
<main>
|
|
<h1>Echo Test</h1>
|
|
|
|
<div role="tablist" hx-target="#page" hx-push-url="false">
|
|
<a role="tab" href="/ws-echo.html" aria-selected="true">Legacy Style</a>
|
|
<a role="tab" href="/ws-echo-ext.html">New Style</a>
|
|
</div>
|
|
|
|
<h3>Description</h3>
|
|
<p>This test lets you send and receive data to and from the WebSocket server. Every message that you send to the server will be "echoed"
|
|
back to you in a separate message</p>
|
|
|
|
<h3>Example HTML</h3>
|
|
|
|
<pre class="code">
|
|
<div hx-ws="connect:ws://localhost/echo">
|
|
|
|
<form hx-ws="send">
|
|
<input type="text" name="message" style="width:500px;" value="This Is The Message" />
|
|
<input type="submit"/>
|
|
</form>
|
|
|
|
<div id="idMessage"></div>
|
|
</div>
|
|
</pre>
|
|
|
|
<div class="elastic container" hx-ws="connect:/echo">
|
|
|
|
<form hx-ws="send">
|
|
<h3>Send a Message</h3>
|
|
<div>
|
|
<input type="text" name="message" style="width:500px;" value="This Is The Message" />
|
|
<input type="submit" value="Send" class="btn primary"/>
|
|
</div>
|
|
</form>
|
|
|
|
<br>
|
|
<h3>Receive a Message</h3>
|
|
<div id="idMessage"></div>
|
|
</div>
|
|
</main/>
|