Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JQuery plugin for html 5 local storage? [closed]

Tags:

Are there any good jquery plugins for using html 5 local storage?

like image 621
Kyle Avatar asked Nov 13 '10 01:11

Kyle


People also ask

Does HTML5 have local storage?

Because HTML5 local storage is natively integrated into Web browsers, it is available without third-party browser plug-ins. It is described in the HTML5 specifications. Local storage is mainly used to store and retrieve data in HTML pages from the same domain.

Can I store HTML in localStorage?

Save the HTML to localStorage # The innerHTML property returns the HTML inside an element as a string, which makes it the perfect way for us to get and store our list. Let's automatically save a users list every time they add an item to it. You use the localStorage. setItem() method to save data to localStorage .

Does HTML support offline storage?

The local storage is a type of HTML5 offline storage that allows user string data to be saved synchronously in their browser. Information is kept in name and value pairs and not available between different browsers on the same device. Local storage can be used as an alternative to cookies.


2 Answers

There's no need for plugins here, since you can access it very quickly:

localStorage.setItem("key", "value");
var value = localStorage.getItem("key");

That's not to say someone won't make plugins in the future (but how would you do cross-browser support? either there's local storage or there isn't). But you don't need to wait on a plugin for anything here, you can start using it (provided the browser supports it) today.

like image 161
Nick Craver Avatar answered Oct 12 '22 02:10

Nick Craver


If you want a light plugin that has compatibilty with old browsers use this:

https://github.com/artberri/jquery-html5storage

like image 31
artberri Avatar answered Oct 12 '22 00:10

artberri