Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 88abef92

Von Moritz Bunkus vor mehr als 11 Jahren hinzugefügt

  • ID 88abef92ceaa2f2f297eb0b2a9a64418bed97ba7
  • Vorgänger 2cb9fa7e
  • Nachfolger 50f19777

ClientJS: Daten bei AJAX-Submits als POST-Content schicken, nicht an die URL dran

Unterschiede anzeigen:

js/client_js.js
129 129
};
130 130

  
131 131
ns.submit_ajax_form = function(url, form_selector, additional_data) {
132
  var separator = /\?/.test(url) ? '&' : '?';
133
  $.post(url + separator + $(form_selector).serialize(), additional_data, ns.eval_json_result);
132
  var data = $(form_selector).serialize();
133
  if (additional_data) {
134
    if (data)
135
      data += '&';
136
    data += typeof additional_data == "string" ? additional_data : $(additional_data).serialize();
137
  }
138

  
139
  $.post(url, data, ns.eval_json_result);
140

  
134 141
  return true;
135 142
};
136 143

  
scripts/generate_client_js_actions.tpl
36 36
};
37 37

  
38 38
ns.submit_ajax_form = function(url, form_selector, additional_data) {
39
  var separator = /\?/.test(url) ? '&' : '?';
40
  $.post(url + separator + $(form_selector).serialize(), additional_data, ns.eval_json_result);
39
  var data = $(form_selector).serialize();
40
  if (additional_data) {
41
    if (data)
42
      data += '&';
43
    data += typeof additional_data == "string" ? additional_data : $(additional_data).serialize();
44
  }
45

  
46
  $.post(url, data, ns.eval_json_result);
47

  
41 48
  return true;
42 49
};
43 50

  

Auch abrufbar als: Unified diff