Friday, January 6, 2012

jStorage - store data locally with JavaScript

jStorage is a simple wrapper plugin for Prototype, MooTools and jQuery to cache data (string, numbers, objects, even XML nodes) on browser side. Note that functions, DOM nodes, host objects and such can not be saved.

jStorage makes use of HTML5 local storage where available and userData behavior in Internet Explorer older versions. Webkit SQLite is not supported.
Current availability: jStorage supports all major browsers - Internet Explorer 6+, Firefox 2+, Safari 4+, Chrome 4+, Opera 10.50+
If the browser doesn't support data caching, then no exceptions are raised - jStorage can still be used by the script but nothing is actually stored.
jStorage is really small, just about 2 kB when minified (under 1kB when gzipped)!

Browser Storage support Survives browser restart Survives browser crash Storage size
Chrome 4 + + + 5 MB
Firefox 3.6 + + + 5 MB
Firefox 3 + + + 5 MB
Firefox 2 + + + 5 MB
IE8 + + + 10 MB
IE7 + + + 128 kB
IE6 + + + 128 kB
Opera 10.50 + + - 5 MB
Opera 10.10 - N/A N/A N/A
Safari 4 + + + 5 MB
Iphone Safari + + + 5 MB
Safari 3 - N/A N/A N/A


jStorage can be downloaded at github (direct download link)


No comments:

Post a Comment