blob: eb76bdc00a640b96aacbd9a3964e4e1ed389959a (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
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.overrideMimeType('text/json');
return (JSON.stringify(parameters));
}
});
|