Can JavaScript survive a full HTTP Request Roundtrip?

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前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准