mirror of
https://github.com/bigskysoftware/htmx.git
synced 2025-09-29 22:11:22 +00:00
Merge branch 'master' into dev
This commit is contained in:
commit
d3f0fa36d3
@ -1,7 +1,12 @@
|
|||||||
htmx.defineExtension('json-enc', {
|
htmx.defineExtension('json-enc', {
|
||||||
|
onEvent: function (name, evt) {
|
||||||
|
if (name === "configRequest.htmx") {
|
||||||
|
evt.detail.headers['Content-Type'] = "application/json";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
encodeParameters : function(xhr, parameters, elt) {
|
encodeParameters : function(xhr, parameters, elt) {
|
||||||
xhr.setRequestHeader('Content-Type', 'application/json');
|
|
||||||
xhr.overrideMimeType('text/json');
|
xhr.overrideMimeType('text/json');
|
||||||
return (JSON.stringify(parameters));
|
return (JSON.stringify(parameters));
|
||||||
}
|
}
|
||||||
});
|
});
|
@ -18,7 +18,7 @@ Here is an example:
|
|||||||
|
|
||||||
```html
|
```html
|
||||||
<div hx-sse="connect /event_stream">
|
<div hx-sse="connect /event_stream">
|
||||||
<div hx-get="/chatroom" hx-trigger="chatter">
|
<div hx-get="/chatroom" hx-trigger="sse:chatter">
|
||||||
...
|
...
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -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
|
htmx includes a set of extensions out of the box that address common developer needs. These extensions are tested
|
||||||
against `htmx` in each distribution
|
against `htmx` in each distribution
|
||||||
|
|
||||||
### Included Extensions List
|
### <a name='reference'></a> [Included Extensions List](#reference)
|
||||||
|
|
||||||
<div class="info-table">
|
<div class="info-table">
|
||||||
|
|
||||||
|
@ -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)
|
## <a name="attributes"></a> [Attribute Reference](#attributes)
|
||||||
|
|
||||||
<div class="info-table">
|
<div class="info-table">
|
||||||
@ -49,7 +58,7 @@ title: </> htmx - Attributes
|
|||||||
|
|
||||||
## <a name="headers"></a> [HTTP Header Reference](#headers)
|
## <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">
|
<div class="info-table">
|
||||||
|
|
||||||
@ -69,7 +78,7 @@ title: </> htmx - Attributes
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
### <a name="response_headers"></a> [Response Headers](#response_headers)
|
### <a name="response_headers"></a> [Response Headers Reference](#response_headers)
|
||||||
|
|
||||||
<div class="info-table">
|
<div class="info-table">
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user