There is a code:
$('#pjaxcontainer form').live('submit',function(a){ // display loading message $('#loading-shade').show(); if( !$(a.target).attr('action')) a.target = $(a.target).closest('form'); data = $(a.target).serialize(); cont = $('#pjaxcontainer'); $.ajax({ type: "POST", url: $(a.target).attr('action'), data: data, beforeSend : function(xhr) { return xhr.setRequestHeader('X-PJAX','true'); // IMPORTANT }, success: function(msg){ cont.html(msg); $('#loading-shade').hide(); }, error: function(a,b,c) { $('#loading-shade').hide(); } }); a.preventDefault(); return false;
});
But it does not send the data of the button on which the submit occurs. How to fix?