I have a button where when user clicks on it will call a jQuery.post() function to call a PHP file to retrieve large amount of data (almost millions of row) from a database and .append() the returned data into a DataTable.
However every time I refresh the page, whatever that has been .append() disappears.I've been searching for hours now but the answers all suggest the use of local storage or cookies. Now I'm pretty sure storing that large amount of data in the local storage or cookies is either impossible or really inefficient.
I am wondering if there any better way of retaining that large amount of data after every time refresh?
function getData()
{
var tableName = $("#btn").val();
$.post("getData.php",
{
tableName1: tableName
}, function (data)
{
//The getData.php will return the values of tr and td
$("#tableResults").append(data);
});
}
<input type="button" value="Customers" id="btn" onclick="getData();" />
<table id="tableResults">
</table>