pjamourik
Posts: 0
Joined: Mon May 26, 2014 12:22 pm

How to access local storage

Hello,

With last update i've read some comments that to access local storage, i should use this :

code
alert(1);
$a.storage.editMessageId.set("1000000");
alert(2);
alert($a.storage.editMessageId.get());
/code

editMessageId is the local var name i would like to set / get.

Above will alert 1, not 2 so it breaks when i try to set the var...

Can anyone explain how to do this?

Thanks,

Peter

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

How to access local storage

Hi Peter,

You can still use these functions for work with localStorage:prelocalStorage.getItem('name');
localStorage.setItem('name', 'value');/pre

pjamourik
Posts: 0
Joined: Mon May 26, 2014 12:22 pm

How to access local storage

Hi Katya,

Thanks for the reply, i see it's working...but :

But will it also be working when the "roll-backed" update will eventually be submitted again.

You see, if I will write my code now, will I have to update the entire code again to use the new method...that would be a lot extra work!?

Thanks,

Peter

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

How to access local storage

Hi Peter,

You can use localStorage.getItem, localStorage.setItem as they will work in future Appery.io versions.

Return to “Issues”