I have used jQuery AJAX got a string of JSON in the login page. How can I use it in other pages. Are there some method to store the JSON and access it anywhere in my website. p
You can use localStorage.
// Store
localStorage.setItem("json", JSON.stringify(json));
// Retrieve
JSON.parse(localStorage.getItem("json"));
You can use localStorage
or cookie
to store your json
.
Read about Web-storages
But remember cookie
has size limitations, read this.
You can store json in .json
files, and requests can go to those files and parse the responsetext with JSON.parse