×

Please give details of the problem

Skip to content

JavaScript script inclusion

Example 1:

Code

1
2
3
4
5
6
7
8
<@script env="javascript">  
function get_fullname(firstname,lastname) {  
var fullname = firstname + " " + lastname;  
return fullname;  
}
var tmp = get_fullname(user_fullname,user_lastname);  
setVariable("user_fullname",tmp);  
<!--@script-->

Tip : to display tmp value in the testing console, write print(tmp);

2012-04-24_105210

Example 2:

2011-12-20_163715

Regardless of the name of the variable you put in front of the script ('foo' here), every time you call setVariable, a new computed parameter will be created ('sum' here).