Page 1 of 1

Variables in external files

Posted: Tue Apr 23, 2013 1:25 pm
by barrymol
Can I use extension builder variables in external javascript files?

Re: Variables in external files

Posted: Tue Apr 23, 2013 1:55 pm
by Pablo
Yes

Re: Variables in external files

Posted: Tue Apr 23, 2013 2:20 pm
by barrymol
Short question with an even shorter answer :D

Re: Variables in external files

Posted: Tue Apr 23, 2013 3:01 pm
by barrymol
For this to work, I assume that at build time, WB will create the actual file in the directory
I specify replacing the variable name with the value.

If I want to use the extension on more than one page and the value for the parameter
needs to be different, I would need to have WB create another instance of the file
in another directory. Right?

Re: Variables in external files

Posted: Tue Apr 23, 2013 3:08 pm
by Pablo
Please check out the documentation for more details (page 12).

Re: Variables in external files

Posted: Tue Apr 23, 2013 3:17 pm
by barrymol
OK. I see the parameter to set so that the file will be processed.
Can I assume that even though I have only one instance of the
javascript file that I have placed in a specific directory, that file
will be modified each time a different page is loaded into the
browser?

In other words, is the resultant file dynamically created specific
to the current pages requirements?

Re: Variables in external files

Posted: Tue Apr 23, 2013 3:55 pm
by Pablo
Yes, unless you make the name of the file variable, so each page can use a different instance of the file.