Everybody say that window.localStorage
is supported by IE (until IE8)
I test it on IE9 but :
console.log(typeof window.localStorage)
undefined
what does it mean?
What's the best way to store local data for all browser?
Everybody say that window.localStorage
is supported by IE (until IE8)
I test it on IE9 but :
console.log(typeof window.localStorage)
undefined
what does it mean?
What's the best way to store local data for all browser?
Local Storage is stored relative to an origin.
This means you must open your page using http://someorigin/pathtoyourpage.html
. It can't work on IE if you're opening the page in file://pathtoyourpage.html
(and shouldn't work on other browsers).
So you need to access your page using a web server (it can be on localhost).
What about Storage.js ?
https://sites.google.com/site/daveschindler/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. "