I'm doing an ajax request and I want to save data I receive from it on a page as oppossed to saving it in a variable. How can I do that?
If you want to keep the data in memory, you can use browser's local storage :
With local storage, web applications can store data locally within the user's browser.
// Store localStorage.setItem("lastname", "Smith"); // Retrieve document.getElementById("result").innerHTML = localStorage.getItem("lastname"); Try it Yourself »
document.getElementById("result").innerHTML = ajaxResult;