Page 1 of 1

2 questions re: local variables

Posted: Fri Feb 08, 2013 4:05 pm
by New Mobile Guy

First, how do I access the local variables in javascript? I tried accessing it by the name, and it didn't work.

Second, will the value of the local variables be saved across sessions when you're testing the app? (via the Test button on the IDE?) Or do I need to publish it for this to work?

Thanks.


2 questions re: local variables

Posted: Fri Feb 08, 2013 4:53 pm
by Kateryna Grynko

Hi!

1) to access the local variables in javascript you should set variable:codelocalStorage.setItem("varName", "value");/code and then read it codevar variable = localStorage.getItem("varName");/code
2) yes, it's saved across sessions


2 questions re: local variables

Posted: Fri Feb 08, 2013 6:38 pm
by New Mobile Guy

Works, thanks!