aboutsummaryrefslogtreecommitdiff
path: root/data/stuff/js
diff options
context:
space:
mode:
Diffstat (limited to 'data/stuff/js')
-rw-r--r--data/stuff/js/util.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/data/stuff/js/util.js b/data/stuff/js/util.js
new file mode 100644
index 0000000..a6826db
--- /dev/null
+++ b/data/stuff/js/util.js
@@ -0,0 +1,12 @@
+jQuery(function($) {
+ "use strict";
+
+ window.send = function(fn, args) {
+ return $.ajax({
+ url: "/api/" + fn,
+ method: 'POST',
+ dataType: 'json',
+ data: args,
+ });
+ };
+});