简体   繁体   中英

How to store a list in the web sql or any type of storage in the browser

如何在Web sql或浏览器中的任何类型的存储中存储列表,我发现了三种在浏览器中存储数据的方式,即localstorage,会话存储和带有html5的web sql,因此我需要存储java.util。在浏览器中列出列表,以后需要对其进行修改,那么有什么办法吗?

I'm not sure - you need to store and manipulate the 'List' on the server or on the client?

In the first case you may use session. In second case you can't use session because you can not access session variables in javascript.

In such situation I'm usually creating hidden field (if it's something page related) or cookie (if it's something application related). Using base64 you may pass transformed to string List to the client, modify them and save. Of course later you may read the data on the server.

我得到了答案,我们需要首先在页面的本地var中获取列表,然后通过javascript对其进行迭代并存储在本地浏览器数据库中。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM