[eluser]neomech[/eluser]
Hi there. I have a feeling this is a simple problem, but I can't figure it out.
I have a site that uses some dynamic javascript in the view. I know how to pass php variables to the view from my controller and use them to create the javascript I want on the page.
What I am trying to do is pass the variables to an external javascript file. I like to keep all my javascript code in external files (and that seems to be widely encouraged). I know how to use a dynamic external .js file using the .php extension, and I can run php code in the external javascript file just fine.
What I DON'T know how to do is to pass php variables from my controller that will somehow make their way into the external javascript files. I realize I could call the external javascript files with a querystring that I could set dynamically, but what if I want to pass in an array, or a simplexml object or something. I tried using global variables and didn't seem to get anywhere with that.
Does anyone know how to do what I'm attempting? Is it even possible?