Here are four options for carrying something from one page to the next:
Set a cookie value on the first page and then when the second page loads, read that cookie value.
Set a local storage value on the first page and then when the second page loads, read that local storage value.
Add a query parameter to the URL of the second page before dispatching to it and then parse that query parameter off the URL when the second page loads.
Store the parameter on your server (either via post or ajax call) so it can be available for the second page either incorporated into the second page by your server or queried from the server by the second page (via ajax).
If there's no reason to persist this value on your server and you don't need it to automatically expire in some short period of time and you don't need support before IE 8, then Local Storage is probably the simplest.
The advantage of storing it on the server is that the value will be available for this user (assuming you have a user login) no matter which browser they use.
The advantage of using a cookie is that it works in all browsers.
The advantage of using a query parameter is that there is no long term storage of the setting (it is essentially a one time thing).
The advantage of using Local Storage is that it's the simplest, but only applies to this particular browser.
Here's how simple Local Storage is:
// on page 1
localStorage.setItem("myValue", "foo");
// upon load of page 2
var myVar = localStorage.getItem("myValue");
if (myVar) {
// code to do something based on the value of myVar
}
With local storage, remember that you're storing strings so if your native value isn't a string, you will have to convert it into the right type when you read it and make sure you're storing the right string value.