ClientJS: Unterstützung für Browser-Redirects ("$js->redirect_to")
[kivitendo-erp.git] / scripts / generate_client_js_actions.tpl
index 7fa7baf..55206ea 100644 (file)
@@ -32,6 +32,12 @@ function eval_json_result(data) {
   // console.log("current_content_type " + $('#current_content_type').val() + ' ID ' + $('#current_content_id').val());
 }
 
+function submit_ajax_form(url, form_selector, additional_data) {
+  var separator = /\?/.test(url) ? '&' : '?';
+  $.post(url + separator + $(form_selector).serialize(), additional_data, eval_json_result);
+  return true;
+}
+
 // Local Variables:
 // mode: js
 // End: