I am trying to do the following:
var departmentName = '{tag_name}';
$(function() {
if (departmentName == 'Accounting') { var manager = $('{module_webapps,12345,c,98765,,,true,,,}'); var staff = $('{module_webapps,12346,c,98766,,,true,,,}'); $('#managerContainer').append(manager); $('#staffContainer').append(staff); } });<div id="managerContainer"></div><div id="staffContainer"></div>
There's a "Departments" web app, and there's an "Employees" web app.
I want to use the above code in the detail template of Departments, where a list of managers and staff members of that department are listed which are taken from the Employees web app.
However, when storing the HTML code that those {module_webapps} tags generate, I get errors saying that I am trying to store illegal characters. Presumably this is because the HTML code is in multiple lines, and other characters that need to be escaped or something.
Can anyone suggest a way for me to store those tags' renderred results in a jquery/js variable? Or any alternative?