Can you setup a variable for javascript in one page and have another page load and still have it recognize the variable?
Can you setup a variable for javascript in one page and have another page 开发者_StackOverflow社区load and still have it recognize the variable?
No.
Instead, you can use cookies.
You can also use Offline Storage, but that's not supported by older browsers.
there are some javascript-frameworks (e.g. persistjs and dojo storage) which allow to do cross-browser persistent storage of variables (using a variety of backends such as html5 localstorage, ie userbehavior, google gears, flash). better then native localstorage (as that is not supported by all browsers) and better then cookies (as they get sent back and fro with every request and response).
hope this helps
精彩评论