Reputation: 7215
I have ajax call and pull the data and I want to send the response to next page in ajax success and get the data in drilldown.html
$.ajax({
type: "POST",
url: "drilldown.php",
data:data,
success: function(response){
window.location.href = 'drilldown.php'; // want to post the data this in redirection
}
});
Upvotes: 3
Views: 2080
Reputation: 2211
If there is no server-side involved, you can save the data using
Window.localStorage
(check if browser compatibility is OK for you)
$.ajax({
type: "POST",
url: "drilldown.html",
data:data,
success: function(response){
localStorage.setItem('myData', data);
window.location.href = 'drilldown.html'; // want to post the data this in redirection
}
});
On the drilldown.html
page, you can read the data with JavaScript by
var data = localStorage.getItem('myData');
There's also sessionStorage
which will be cleaned up after browser restart.
Upvotes: 3