网站如何“离线”运营?模式,具有本地数据存储?
我正在开发一个需要离线存储数据的网站。即,如果网络出现故障,数据将存储在客户端的本地 PC 上,并在用户下次上线时发送到服务器。
为了检测网络状态,我使用了对服务器的 jQuery AJAX 调用(我愿意接受其他可能的方式)。这里的挑战是以安全的方式将数据存储在本地,以便用户不会有意或无意地删除数据。
我怎样才能做到这一点?
I am working on a website which requires offline storage of data. i.e. if the network is down the data is stored locally on the client's PC and it is sent to the server next time the user goes online.
For detecting the network status I have used jQuery AJAX calls to the server (I am open to other possible ways). The challenge here is to store the data locally in a secure way so that the data can't be deleted by the user intentionally or accidentally.
How can I achieve that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试本地存储 API。 http://hacks.mozilla.org/2009/06/localstorage/ 已实施一些现代浏览器。
编辑:在大多数浏览器中,清除 cookie 会清除 localStorage。
Try the localStorage API. http://hacks.mozilla.org/2009/06/localstorage/ It's implemented a few modern browsers.
EDIT: In most browsers, clearing cookies clears localStorage.