I want to send an array or in the worst case just a number when I am redirecting to another page I do this through a js function. what it does there is that when you click on a button in the datatable it redirects you to another page but before it retrieves the information of the row where you clicked that information I want it to reach the other page how can I do it?
$('#myTable tbody').on('click', 'button', function () {
var data = dataTable.row($(this).parents('tr')).data();
console.log(data);
window.location.href = "../Entrega-unidades?$data";
});
This is what I had on the other page but it has no values.
const valores = window.location.search;
//Mostramos los valores en consola:
console.log(valores);
It is not recommended to send this type of information by URL, but you can convert the object to base 64 and then receive it as a parameter of the url
from the page where the value is received in your case Delivery-units