prashant purohit
Posts: 0
Joined: Sat Aug 31, 2013 11:00 am

Accessing Local Storage variable

Hi,

I have created a local storage variable "text". I am setting its value to "PPPPPP" in a program deployed on local host. The same you can see on the browser console screen shot attached below. However, I am not able to get the value from the local storage variable. I am using the below code to get the value:

var mystatus = localStorage.getItem('text');
alert(mystatus);

Please suggest, if there are any different commands to get this done. Image

Igor
Posts: 0
Joined: Tue Apr 02, 2013 12:05 pm

Accessing Local Storage variable

Hi,

What is the event order when you set and get localStorage variable?
Please try using this code on button click event.
pre
localStorage.setItem('text',"TEST_LST");
var mystatus = localStorage.getItem('text');
alert(mystatus);
/pre

Return to “Issues”