Reputation: 21
If I generate an array in JavaScript, is it possible to configure a Freemarker template in the JavaScript code, in order to generate html which dynamically displays the array's elements?
Upvotes: 0
Views: 391
Reputation: 382
freemarker can display javascript.
function doSomeThing(){
<#if !user??>
location.href="www.xxx.com/login.htm"
</#if>
other js
}
if you want to create dynamically js depend by the some arg you can use macro to define yourself function. to show some different js code snippet by the input arg.
Upvotes: 0
Reputation: 31152
If we are talking about JavaScript running in the browser, then no, because FreeMarker runs on the server side before the page is sent to the browser.
Upvotes: 1