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>]