0

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?

2 Answers 2

1

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.

Sign up to request clarification or add additional context in comments.

Comments

0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.