Hi all,
I have a custon.js file that I need to be able to alter some elements of via tv's, I've tried adding the js to a chunk and then calling that in my footer chunk but noting I do appears to work.
Could someone let me know how to include javascript so that I can alter it with TV's please as I'm having a brain block today :/
Have got this working by adding The jquery to the bottom of the template but would prefer to be able to include it, Any ideas ?
Thanks
this isn't possible.
Included javascript is loaded by the browser directly, not by modx.
As soon as you want manipulate your javascript by modx at parsing-time, you will need to add your javascript-code into modx-elements (chunks,snippets,TVs,templates)
Of course its possible to prepare some javascript-Vars by modx and use this vars in your included javascript.
Cheers Bruno, I'll stick with having it in the template direct in that case.
Thanks for replying.