HTML5 Series (11) Store.js-Easy to implement local storage (Localstorage) __div

Source: Internet
Author: User

Store.js is a localstorage wrapper that is compatible with all browsers, without the use of cookies or Flash. Store.js will automatically choose to use Localstorage, Globalstorage, or userData to implement local storage capabilities according to the browser.

Store.js provides a very concise API to enable Cross-browser local storage capabilities:?

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17-18 Store.set (' username ', ' Marcus ') Store.get (' username ') store.remove (' username ') store.clear () store.set ("User    ', {name: ' Marcus ', Likes: ' JavaScript '} ' var user = Store.get (' user ') alert (user.name + ' likes ' + user.likes) Get all stored values Store.getall (). User.Name = = ' Marcus '//Loop over all stored values Store.foreach (function (Key, Val) {Console.log (key, ' = = ', val)})
Supported Browsers:Tested in iOS 4 tested in iOS 5 tested in iOS 6 tested in Firefox 3.5 tested in Firefox 3.6 tested in Firefox 4.0+ Support Dropped for Firefox < 3.5 (and notes below) tested in Chrome 5 tested in Chrome 6 tested in Chrome 7 tested in Chrome 8 tested in chrome tested in chrome 11+ tested in Safari 4 tested in Safari 5 tested in IE6 tested in IE7 tested in IE8 Tested in IE9 tested in IE10 tested in opera tested in opera one tested in opera one tested in Node.js v0.10.4 (with HTT Ps://github.com/coolaj86/node-localstorage 1.0.2)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.