Passing javascript variable to velocity variable templete

Description
charan-ram
Posts: 3
Joined: Tue Oct 17, 2017 7:52 am

Passing javascript variable to velocity variable templete

Postby charan-ram » Thu Oct 26, 2017 8:37 am

Hi everyone,
Could anyone please tell me that how can I pass javascript varible to velocity templete. I have gone through few forums that I need to pass the parameter to server to get this but I have no idea. Please find the files below. Thank you.

Code: Select all

<script type="text/javascript">
function generateFunction()
{
  var variable = document.getElementById('text').value;
}
</script>

#set($test = "variable")
$test

martins
Posts: 180
Joined: Thu Nov 05, 2009 3:24 pm

Re: Passing javascript variable to velocity variable templete

Postby martins » Thu Nov 30, 2017 2:48 pm

I don't understand what's your intention. Maybe you can describe your usecase more in detail.

Javascript code is normaly executed on client side (in the user's web browser) but velocity code is already executed on server side before the webserver delivers the content to the browser.

Martin


Return to “Polarion Application Lifecycle Management (ALM)”

Who is online

Users browsing this forum: Bing [Bot] and 1 guest