There are 2 scripts:
The first one takes data from 2 forms and sends it to the handler (filter)
$(document).on('change','.sort_order',function(){ var url = "ajax/objects.php"; var dataString = $("#search_form, #order-form").serialize(); $.ajax({ type: "POST", url: url, data: dataString, success: function(data) { $('.ajax_result').html(data); } , error: function(){ alert('failure'); } }); }); The second one takes the id of the link and sends it there (Page navigation)
$(document).on('click','.pag',function(){ var url = "ajax/objects.php"; var id = $(this).attr('id'); var dataString = 'id='+ id ; var parent = $(this); $.ajax({ type: "POST", url: url, data: dataString, success: function(data) { $('.ajax_result').html(data); } , error: function(){ alert('failure'); } }); }); How to combine these 2 scripts in 1?
That the script sent the data from forms and id links