Fix all ampersands before XHR-submitting a form

This commit is contained in:
Thomas Gelf 2014-03-25 07:44:24 +00:00
parent 9c5eb19af6
commit ff3d351c8f
1 changed files with 3 additions and 1 deletions

View File

@ -171,7 +171,9 @@
// .closest is not required unless subelements to trigger this
var $form = $(event.currentTarget).closest('form');
var url = $form.attr('action').replace('&', '&'); // WHY??
var regex = new RegExp('&', 'g');
var url = $form.attr('action').replace(regex, '&'); // WHY??
var method = $form.attr('method');
var $target;
var data = $form.serializeArray();