Page 1 of 1

How to access local storage

Posted: Fri Jun 06, 2014 9:25 am
by pjamourik

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


How to access local storage

Posted: Fri Jun 06, 2014 10:01 am
by Kateryna Grynko

Hi Peter,

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


How to access local storage

Posted: Fri Jun 06, 2014 10:05 am
by pjamourik

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


How to access local storage

Posted: Fri Jun 06, 2014 12:32 pm
by Kateryna Grynko

Hi Peter,

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