开发者

Can you setup a variable for javascript in one page and have another page load and still have it recognize the variable?

开发者 https://www.devze.com 2022-12-21 23:38 出处:网络
Can you setup a variable for javascript in one page and have another page 开发者_StackOverflow社区load and still have it recognize the variable?No.

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

0

精彩评论

暂无评论...
验证码 换一张
取 消