Skip to content

A simple, lightweight jQuery plugin for reading, writing and deleting html5 local storage

License

Notifications You must be signed in to change notification settings

hosokawat/jquery-localstorage

Repository files navigation

MIT License Build Status npm version

jquery-localstorage

A simple, lightweight jQuery plugin for reading, writing and deleting html5 local storage

Installation

CDN

Just put this tag:

<script src="https://cdn.jsdelivr.net/gh/hosokawat/jquery-localstorage/jquery.localstorage.min.js"></script>

Download

Include script after the jQuery library (unless you are packaging scripts somehow else):

<script src="/path/to/jquery.localstorage.js"></script>

Usage

Save:

value = $.localStorage('key', 'value');

Read:

value = $.localStorage('key');

Read all (values.constructor is Storage):

values = $.localStorage();

Initialization result:

result = $.support.localStorage;

IO methods

Save:

io = $.localStorage.io('key');
value = io.write("value");

Read:

io = $.localStorage.io('key');
value = io.read();

Remove:

io = $.localStorage.io('key');
io.remove();

Key:

io = $.localStorage.io('key');
io.key;

Jasmine Test

TestPage

About

A simple, lightweight jQuery plugin for reading, writing and deleting html5 local storage

Resources

License

Stars

Watchers

Forks

Packages

No packages published