Merge branch 'master' into dev

This commit is contained in:
carson 2020-06-15 18:25:31 -07:00
commit d3f0fa36d3
4 changed files with 20 additions and 6 deletions

View File

@ -1,7 +1,12 @@
htmx.defineExtension('json-enc', {
onEvent: function (name, evt) {
if (name === "configRequest.htmx") {
evt.detail.headers['Content-Type'] = "application/json";
}
},
encodeParameters : function(xhr, parameters, elt) {
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.overrideMimeType('text/json');
return (JSON.stringify(parameters));
}
});
});

View File

@ -18,7 +18,7 @@ Here is an example:
```html
<div hx-sse="connect /event_stream">
<div hx-get="/chatroom" hx-trigger="chatter">
<div hx-get="/chatroom" hx-trigger="sse:chatter">
...
</div>
</div>

View File

@ -38,7 +38,7 @@ and on the `body` tag for it to apply to all htmx requests.
htmx includes a set of extensions out of the box that address common developer needs. These extensions are tested
against `htmx` in each distribution
### Included Extensions List
### <a name='reference'></a> [Included Extensions List](#reference)
<div class="info-table">

View File

@ -4,6 +4,15 @@ title: </> htmx - Attributes
---
## Contents
* [Htmx Attribute Reference](#attributes)
* [Htmx CSS Class Reference](#classes)
* [Htmx Request Headers Reference](#request_headers)
* [Htmx Response Headers Reference](#response_headers)
* [Htmx Event Reference](#events)
* [Htmx Extensions Reference](/extensions#reference)
## <a name="attributes"></a> [Attribute Reference](#attributes)
<div class="info-table">
@ -49,7 +58,7 @@ title: </> htmx - Attributes
## <a name="headers"></a> [HTTP Header Reference](#headers)
### <a name="request_headers"></a> [Request Headers](#request_headers)
### <a name="request_headers"></a> [Request Headers Reference](#request_headers)
<div class="info-table">
@ -69,7 +78,7 @@ title: </> htmx - Attributes
</div>
### <a name="response_headers"></a> [Response Headers](#response_headers)
### <a name="response_headers"></a> [Response Headers Reference](#response_headers)
<div class="info-table">