I’m running a express server and render a list.
This is the code of the route:
try {
let result = await servCollections.prepareDataForListCollections();
let colls = result.data;
let messages = result.messages;
res.render('../views/pages/listcollections', { daten: colls, mess: messages });
} catch (err) {
console.error(`Error while getting collections `, err.message);
next(err);
}
In my ejs view I want to pass the mess variable to a javascript function like so:
<main>
<script>populateMultiMessages( <%= mess %> )</script>
Then I got the above error, which I can`t understand. Here is the content from mess in a debugger view: