Passing velocity variable to javascript | Community
Skip to main content
New Participant
August 17, 2023
Question

Passing velocity variable to javascript

  • August 17, 2023
  • 0 replies
  • 570 views

Hi All,

I am passing velocity variables like $e.name to JS and able to retrieve the same. But, I was also passing $entities to JS and was able to retrieve which all of a sudden is not working anymore. Could you please suggest what could be wrong in the below snippet and any alternatives?

 

#set($entitylist=$entities)
<script type="text/javascript">
var listofitems= "${entitylist}";

console.log(listofitems);

</script>

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.