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

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -