Hi,
I have created a new module in EE and in mod.newmodule.php I am executing a query. After processing the query, the results create an array. I need to use this array in JavaScript of the template of the calling module. How can I access this array created in mod.newmodule.php through the javascript of the template?
Please help.
Thanks.
Mod Edit: Moved to the Modules: Technical Assistance forum.
First thought so it might not be the best way:
Could you just inline some javascript right in the body of the HTML? So in your template it would look something like:
[removed]<!--
var x = {your_query_results_here};
-->[removed]";
Edit to add: Interesting - it took out the javascript declaration (guess that’s not safe HTML 😉 )
It should look like:
<5cript type="text/java5cript"><!--
var x = {your_query_results_here};
--></5cript>";
Replace 5 with s.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.