Command Reference CIB jsMerge

JavaScript Functions

Global Functions

In the script file global functions and variables can be defined with the following syntax:

myGlobalFunc = function() { ... }

or

function myGlobalFunc() { ... }

or

i=42

Global functions and variables are valid throughout the document project. They can be overwritten by local functions/variables with the same name in a template. Then the global function/variable defined in the script file is no longer valid in this template (but in all other templates).

The function is referenced via myGlobalFunc(…). E.g. text(myGlobalFunc(…))