summaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
Diffstat (limited to 'src/client')
-rw-r--r--src/client/util.js16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/client/util.js b/src/client/util.js
index 3fd4aecb..a041c813 100644
--- a/src/client/util.js
+++ b/src/client/util.js
@@ -1,6 +1,6 @@
"use strict"
-define(function() {
+define(['jquery'], function($) {
function assert(condition, message) {
if (false == condition) {
@@ -61,6 +61,19 @@ define(function() {
return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
}
+ function form_common__rest_post(rest_path, data, success, error) {
+ $.ajax({ type : "POST",
+ url : rest_path,
+ async : false,
+ cache : false,
+ data : JSON.stringify(data),
+ dataType : 'json',
+ contentType : "application/json; charset=utf-8",
+ success : success,
+ error: error
+ });
+ }
+
return {
assert: assert,
set_from_array: set_from_array,
@@ -68,5 +81,6 @@ define(function() {
set_diff: set_diff,
array_diff: array_diff,
getParameterByName: getParameterByName,
+ form_common__rest_post: form_common__rest_post,
};
});