Is it possible to assign a freemarker list to a Javascript Array? Does any other technique exist to achieve the same?
Suppose I have the following code
<#list messages.thread.messages.topic as message>
<div id="subject">${posts.subject}</div>
<div id="teaser">${posts.teaser}</div>
<div id="body">${message.body}</div>
</#list>
function script(){
//I want to access the free marker list message here
}
Yes it is possible
var arr=[<#list messages.thread.messages.topic as message>${message.body},</#list>]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With