Skip to content

Commit

Permalink
Merge pull request h5bp#41 from krnlde/patch-1
Browse files Browse the repository at this point in the history
Looks good to me, thanks!
  • Loading branch information
beverloo committed Jan 23, 2012
2 parents 6086132 + c1f2eb5 commit b398a39
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion posts/localstorage.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ tags: gtie7 polyfill
kind: api
polyfillurls:[Remy's storage polyfill](https://gist.github.com/350433), [sessionstorage](http://code.google.com/p/sessionstorage/)

Local and session storage are a great way to store data without resorting to cookies. IE8 supported `localStorage` and `sessionStorage` so you may not need a polyfill. If you do, Remy's is a piece of cake to immplement and use.
Local and session storage are a great way to store data without resorting to cookies. IE8 supported `localStorage` and `sessionStorage` so you may not need a polyfill. If you do, Remy's is a piece of cake to implement and use.

This is a simple key/value store, so if you want to store complex data use `JSON.parse(str)` and `JSON.stringify(obj)` on your way in and out. There is also no way to know if you exceeded the storage cross-browser, so wrap your store commands in try/catch. Up to 5MB is safe to use.

0 comments on commit b398a39

Please sign in to comment.