javascript - Unable to remove localStorage data -


this weird error:

localstorage.removeitem("mykey"); var temp = localstorage.getitem("mykey");  // temp = undefined 

but, if ctrl-f5 , this:

var temp = localstorage.getitem("mykey"); console.log(temp); 

then data still there! how can remove it?

to remove localstorage data, with:

localstorage.clear() 

fiddle example: http://jsfiddle.net/f5w3p/

now... remove specific item , not data.. removeitem

localstorage.removeitem('test') 

fiddle example: http://jsfiddle.net/f5w3p/1/

...
if after ctrl+f5 still or same data before...
...then must setting data again before read it.

give full working fiddle example , sure, find's out problem is.


Comments

Popular posts from this blog

hibernate - How to load global settings frequently used in application in Java -

python 3.x - Mapping specific letters onto a list of words -

objective c - Ownership modifiers with manual reference counting -