Browse code

Initial htmx npm packages installation

Benjamin Roth authored on25/05/2023 09:52:13
Showing1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,12 @@
1
+htmx.defineExtension('json-enc', {
2
+    onEvent: function (name, evt) {
3
+        if (name === "htmx:configRequest") {
4
+            evt.detail.headers['Content-Type'] = "application/json";
5
+        }
6
+    },
7
+    
8
+    encodeParameters : function(xhr, parameters, elt) {
9
+        xhr.overrideMimeType('text/json');
10
+        return (JSON.stringify(parameters));
11
+    }
12
+});
0 13
\ No newline at end of file