I want to send json object from page 1 to page 2 without server interaction what i have tried so far is like this
from page 1 i have this code
url = '../reports/page2.php?basicinfo=' + encodeURIComponent(JSON.stringify(basicinfo));
window.open(url + "&month=" + month, '_self');
in page two i acces the data by getting the object from the url.
But i had a problem. I exceeded the The requested URL's length exceeds the capacity limit for this server.
So i wanted to try if it is possible using ajax what i have tried is
var url = '../reports/page2.php;
var basicinfo = JSON.stringify(basicinfo)
$.ajax({
type: 'POST',
contentType: "application/json; charset=utf-8",
dataType: "json",
data: {
action: "page2",basicinfo:'basicinfo '
},
complete: function() {
window.location = url;
}
});
I was directed to the correct page my problem is i cant get the data now.