JavaScript saving to local storage?

This question already has an answer here:

  • Storing Objects in HTML5 localStorage 25 answers

  • I guess you must have gone through this already but I would like to suggest it. For a quick overview go through http://www.w3schools.com/html/html5_webstorage.asp and for a detailed look have a look at http://diveintohtml5.info/storage.html. I think it will server your purpose. It's not very big.


    @Voltrone suggested Lawnchair and while that's a good library for offering fallback implementations of storage (for example if you are on an older browser without localStorage), I would suggest you use lscache instead: https://github.com/pamelafox/lscache

    It's going to make the storage you need to do simpler (just hand it an object to store and a key under which to store it) and it allows you to set how long you want the stuff you store to last if you need to do that.

    链接地址: http://www.djcxy.com/p/27938.html

    上一篇: 本地存储3个对象

    下一篇: JavaScript保存到本地存储?