function calcTotalScore(){
var arr = ["A","B","C","D","E","F"];
$.each(arr, function(n,val){
calcTotal(val);
});
}
calcTotal(value){
// sample code
}
I am using the above function calcTotalScore()
in Velocity Template Language(VTL), but it says:
Encountered "," Was expecting one of:
<EOF>
"(" ...
<RPAREN> ...
<ESCAPE_DIRECTIVE> ...
<SET_DIRECTIVE> ...
"##" ...
"\\\\" ...
"\\" ...
<TEXT> ...
"*#" ...
"*#" ...
<STRING_LITERAL> ...
<IF_DIRECTIVE> ...
<STOP_DIRECTIVE> ...
<INTEGER_LITERAL> ...
<FLOATING_POINT_LITERAL> ...
<WORD> ...
<BRACKETED_WORD> ...
<IDENTIFIER> ...
<DOT> ...
"{" ...
"}" ...
What am I doing wrong?
VTL is interpreting jQuery's
$
as the start of a variable. It then complains because a variable name cannot start with a dot.You have two options:
\$
jQuery
instead of$