Merge branch 'master' into dev

This commit is contained in:
carson 2021-02-18 11:14:09 -07:00
commit a6c09931cd
3 changed files with 4 additions and 4 deletions

View File

@ -35,7 +35,7 @@ By removing these arbitrary constraints htmx completes HTML as a
```html
<!-- Load from unpkg -->
<script src="https://unpkg.com/htmx.org@1.1.0" ></script>
<script src="https://unpkg.com/htmx.org@1.2.0" ></script>
<!-- have a button POST a click via AJAX -->
<button hx-post="/clicked" hx-swap="outerHTML">
Click Me

View File

@ -8,7 +8,7 @@ title: </> htmx - hx-ws
The `hx-ws` allows you to work with [Web Sockets](https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API/Writing_WebSocket_client_applications)
directly from HTML. The value of the attribute can be one or more of the following, separated by commas:
* `connect:<url>` - A URL to establish an `WebSocket` connection against
* `connect:<url>` or `connect:<prefix>:<url>` - A URL to establish an `WebSocket` connection against. Prefixes `ws` or `wss` can optionally be specified. If not specified, HTMX defaults to add the `wss` prefix to the url.
* `send` - Sends a message to the nearest websocket based on the trigger value for the element (either the natural event
of the event specified by [`hx-trigger`])
@ -25,7 +25,7 @@ Here is an example:
</div>
```
This example establishes a WebSocket to the `chatroom` end point. Content that is send down from the websocket will
This example establishes a WebSocket to the `chatroom` end point. Content that is sent down from the websocket will
be parsed as HTML and swapped in by the `id` property, using the same logic as [Out of Band Swaps](/attributes/hx-swap-oob).
The form uses the `send` syntax to indicate that when it is submitted, the form values should be serialized as JSON

View File

@ -481,7 +481,7 @@ These features are under active development, so please let us know if you are wi
If you wish to establish a `WebSocket` connection in htmx, you use the [hx-ws](/attributes/hx-ws) attribute:
```html
<div hx-ws="connect wss:/chatroom">
<div hx-ws="connect:wss:/chatroom">
<div id="chat_room">
...
</div>