Skip to content

Conversation

gildas-lormeau
Copy link
Contributor

The first commit makes this code work as expected:

storage.set("getItem", "fail"); 
localStorage.getItem("foo");

The second commit fixes a bug: result was not declared and wasn't returned when _storage.get was called with an Array of keys

florian pushed a commit that referenced this pull request May 18, 2012
use Storage.setItem and Storage.getItem and fixed a bug in _storage.get method
@florian florian merged commit 9af091b into florian:master May 18, 2012
@florian
Copy link
Owner

florian commented May 18, 2012

Thanks a lot for the bugfix. :)

Edit: Removed some code, that didn't make much sense.

@gildas-lormeau
Copy link
Contributor Author

You're welcome :)

Are you sure the third way of setting items in localStorage really works? On chrome the value is not set.

localStorage.setItem['key'] = 'value';
console.log(localStorage.getItem('key')); // should print "value" in the console

@florian
Copy link
Owner

florian commented May 21, 2012

Oh gosh, this is awkward. localStorage.setItem['key'] = 'value'; doesn't add anything to the localStorage data, it just defines a new property of the setItem method. Sorry for that fail code from me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants