post data with ajax.url().load()
post data with ajax.url().load()
mattct
Posts: 9Questions: 6Answers: 0
Hi
How should I go about posting additional data across to a php server-side data source with an ajax load method?
I have a set of filters that modify the datatable based on a the selected value of each filter - this uses $_GET
.
I need to pass across additional hidden data to the server-side data source using $_POST
$('#filter').on('change', function(event) {
$('#dt_basic').DataTable().ajax.url( 'list?' + $(this).serialize() ).load();
});
Thanks
Answers
You need to use
ajax.data
orpreXhr
to add data to a POST Ajax request for DataTables.Allan
I'm not too clear on what you're doing, but you can use
ajax.data
to add data sent to the server.Colin