jquery-pjax icon indicating copy to clipboard operation
jquery-pjax copied to clipboard

$.pjax.submit submitting to wrong url

Open cihank opened this issue 12 years ago • 1 comments

$.pjax.submit is using wrong action url when the action attribute of the form tag is not entered.

opened /index.php navigated /index2.php using pjax tried to submit a form with no action attribute form is submitted to /index.php

I recommend sending the form to window.location.pathname when action attribute is undefined.

cihank avatar May 20 '13 08:05 cihank

I had same problem with this code :

$(document).on('change', '#group_select', function(event) { $.pjax({url:'', container: '#content', type: 'POST', data: {filter_group_id: this.value}}); });

Sometimes the form is send to current url, sometimes another one. Using window.location.pathname in url fixed it.

yoannk avatar Oct 25 '16 17:10 yoannk