Syntax
js_expression ::= 'js:' string_expression_item
Description
Javascript expressions evaluate arbitrary javascript code. Nowadays it is implemented using the eval function but this can change. Any legal Javascript expression may be evaluated.
The suplied expression is evaluated first as a string expression and the evaluated as javascript code.
Differences with ZPT
Javascript expressions does not exist in ZPT. Javascript expressions work just like Python expressions in ZPT except that the Javascript language is used instead of Python.
Examples
<div data-content="js: 4 + 5">returns the int 9</div> <div data-content="js: ${aNumber} + 1">returns the result of adding 1 to the value of aNumber variable</div>