Page 1 of 1

Get local storage item

Posted: Tue Jun 30, 2015 9:04 am
by TonyS

why doesn' this work?

var lan = localStorage.getItem("language");
alert(lan);

I can do it with set property so the variable exists.

Thanks.


Get local storage item

Posted: Tue Jun 30, 2015 9:43 am
by TonyS

No worries, fixed it. I assumed that if a label value could be set using the set property that the local variable existed. Obviously not, so i created a local variable and call that. It worked.