Is it possible to have JavaScript (specifically, JavaScript variables and their content) survive full HTTP requests? I'd like to 'cache' / persist information client-side across page changes, without having to use hidden form fields or anything HTML related at all.
Is this possible?
**Edit:** Let me add a use case for what I mean.
1. Let's say I have a JavaScript array
called *arrayOfPersons* which I
loaded as part of page /HomePage,
and now it contains 1,000 objects
client-side.
2. Now the user switches the page and
loads an entirely new page /MyAccount into the
browser
3. **My Goal**: Still have the *arrayOfPersons* that I loaded on page /HomePage available after the user requested the entirely new page /MyAccount.
Hope that clarifies what I mean. Thank you! @Fragsworth: Not sure why you would think of AJAX in this context. AJAX is used for asynchronous requests to the server. Not really related to caching information on the client.
以上就是Can JavaScript survive a full HTTP Request Roundtrip?的详细内容,更多请关注web前端其它相关文章!