5.11.2 How to use JavaScript Plugin parts
Place a JavaScript Plugin Part on the node where the JavaScript will be executed.
In a JavaScript Plugin Part, you can define input parameters and output parameters that enable the passing of variables and values inside the JavaScript. By associating a JavaScript Plugin Part with a Guide Part, you can use the value entered in the Guide Part as an input parameter of the JavaScript Plugin Part or an output parameter of the JavaScript Plugin Part to output the values to the Guide Part.
To use input parameters, you have to not only specify the necessary settings in the Attribute Settings window but also link Guide Parts such as text boxes to the input parameters. In this way, the JavaScript is executed according to the values entered by the user. Similarly, to use the values output to the output parameters as the values to be output to the Guide Parts, you have to not only specify the necessary settings in the Attribute Settings window but also link the output parameters to the Guide Parts.
The JavaScript written in a JavaScript Plugin Part is executed at the following timing:
-
When there are no Guide Parts to which the output parameters are connected
The JavaScript is executed when a transition is made from the node on which the JavaScript Plugin Part is placed to the next node.
-
When there are Guide Parts to which the output parameters are connected
If there are no input parameters to which the Guide Parts are connected, the JavaScript is executed when a transition is made to the node on which the JavaScript Plugin Part is placed.
If there are input parameters to which the Guide Parts are connected, the JavaScript is executed when a transition is made to the node on which the JavaScript Plugin Part is placed, and JavaScript output processing is performed when a transition is made to the next node.
Furthermore, with JavaScript Plugin Parts, you can invoke a specified URL by using an APIs (JavaScript APIs) provided by Navigation Platform. For details, see 5.12 APIs that can be used with JavaScript Plugin Parts.