I want to submit data through ajax to the database and after inserting data into database this data should be displayed on the file Demo.html dynamically at t
It's based on answer from @Nikhil Nanjappa.
You can use an array to store more items in localStorage. Store object in localStorage.
AjaxFile.html
success: function(msg) {
document.getElementById('get').innerHTML = msg;
StoredData = JSON.parse(localStorage.getItem("StoredData"));
if(!StoredData) StoredData = [];
StoredData.push(myData1);
StoredData.push(myData2);
localStorage.setItem("StoredData", JSON.stringify(StoredData));
window.location.href = 'Demo.html'
}
Demo.html (At the bottom of the body)