blob: db0aa36f215e436f490d66c209a2640cd9b6e3e1 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
|
htmx.defineExtension('json-enc', {
onEvent: function (name, evt) {
if (name === "htmx:configRequest") {
evt.detail.headers['Content-Type'] = "application/json";
}
},
encodeParameters : function(xhr, parameters, elt) {
xhr.overrideMimeType('text/json');
return (JSON.stringify(parameters));
}
});
|