jquery-pjax
jquery-pjax copied to clipboard
$.pjax.submit submitting to wrong url
$.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.
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.