0
I would like to save in the variable page the value of the current page of a table using the Datatable plugin, by their documentation I believe it is more or less like this, but it is not working.
var table = $('#myTable').DataTable();
var pagina = table.page();
It gives some error ? what happens ? what presents
console.log(pagina);
?– Isac
appears Undefined
– Lucas Scheunemann
And
console.log(table);
gives what? There is an element with idmyTable
? Jquery was included ? the datatables plugin was also included?– Isac
console.log(table); gives [Object objetc], my datatable ta working perfectly, I would just like to be able to save the page number in a php variable.
– Lucas Scheunemann
To do this you must use ajax. Save to a variable only if it is in javascript variable.
– Isac
i am trying to write in a javascript variable, but it’s not rolling.
– Lucas Scheunemann
have you tried making
var pagina = table.page.info().page+1;
? Example of datatables documentation– Isac