GordonG
Posts: 0
Joined: Wed Jun 11, 2014 5:50 am

global javascript variables?

I think I want (would be convenient) to allow functions to access global data without having to call the localStorage api.

I assume I can define some javascript global variables in a script and load it on a screen's startup, but it appears (without trying it myself) the data stored in them would not be available if a new screen loads:

That is to say, a screen is equivalent to a page in HTML, and any data stored global variables defined in scripts attached to one page would be lost when a new page loads - is that correct?

I note in the javascript API documentation that "No matter which way the file is loaded, the JavaScript library will be available on every page in your app."

Does that mean variables that I define in Project javascript files and their assigned data live across screens? (i.e. are global to all screens in the project)

Thanks for the clarifications and any comment on my ideas/misperceptions.

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

global javascript variables?

Hi,

[quote:]That is to say, a screen is equivalent to a page in HTML, and any data stored global variables defined in scripts attached to one page would be lost when a new page loads - is that correct?
[/quote]
Yes.
[quote:]
Does that mean variables that I define in Project javascript files and their assigned data live across screens? (i.e. are global to all screens in the project)
[/quote]
Yes, if you don't use it on the other events on the Screen, otherwise it will refer to that data.

Return to “Issues”