jQuery HTML5 Storage plugin

Provides a simple interface for storing data such as user preferences. The storage plugin is useful for saving and retreiving data from the user's browser. For newer browsers, HTML 5's localStorage is used. If localStorage isn't supported, then cookies are used instead. Retrievable data is limited to the same domain.

Usage:
$.Storage - Represents the user's data store, whether it's cookies or local storage.
$.Storage.set("name", "value") - Stores a named value in the data store.
$.Storage.set({"name1":"value1", "name2":"value2", etc}) - Stores multiple name/value pairs in the data store.
$.Storage.get("name") - Retrieves the value of the given name from the data store.
$.Storage.remove("name") - Permanently deletes the name/value pair from the data store.

Names and values should be strings. Some browsers may accept non-string values, but not all do.
ċ
jquery.Storage.js
(4k)
Dave Schindler,
Oct 6, 2010, 4:23 AM
Comments