简体   繁体   English

HTML5中的localStorage如何工作?

[英]How Does localStorage in HTML5 work?

How Does localStorage in HTML5 work? HTML5中的localStorage如何工作? I searched every where (even in SO ) to find the actual internal logic of localStorage, but I ended up with visiting some examples which uses localStorage. 我搜索了所有地方(甚至在SO中 ),以找到localStorage的实际内部逻辑 ,但是最后我访问了一些使用localStorage的示例。 I haven't found any useful Answer to my question. 我没有找到对我的问题有用的答案。 Can Someone post me a link or explain about the working of localStorage 有人可以给我发布链接或解释localStorage的工作localStorage

I'm not necessarily sure what you're looking for here...but the internal implementation of localStorage is going to be browser specific. 我不一定要确定您在这里寻找什么...但是localStorage的内部实现将特定于浏览器。 I wouldn't count on any two browsers implementing the feature the same way internally (just like everything, the implementation and performance will give each browser a different advantage). 我不会指望任何两个内部实现功能相同的浏览器(就像所有东西一样,实现和性能将给每个浏览器带来不同的优势)。

If you're really interested, I'd suggest pulling down the Chromium source and seeing how they implement things internally. 如果您真的有兴趣,建议您关闭Chromium来源,并了解它们如何在内部实现。

You can use a simple jQuery plugin for store information using localStorage or cookie. 您可以使用localStorage或cookie使用简单的jQuery插件来存储信息。 This plugin it's useful because you don't need control if the browser has or hasn't suport to localStorage. 这个插件很有用,因为您不需要控制浏览器是否支持localStorage。

https://github.com/thyagoquintas/jquery-storage https://github.com/thyagoquintas/jquery-storage

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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