mirror of
https://github.com/bigskysoftware/htmx.git
synced 2025-09-30 22:41:23 +00:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
8933030b52
@ -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));
|
||||
}
|
||||
});
|
||||
});
|
@ -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>
|
||||
|
Loading…
x
Reference in New Issue
Block a user