Specifying required variables for a HTML extension object

The custom code within your HTML extension object can use predefined and user-defined Lectora variables. Lectora Online automatically detects their usage.

You might have scripting that only specifies a portion of the name of the variable in the script. In these cases, you will need to specify the variable name in a comment. For example, if you are using CurrentDate in your script like this:

window['Var'+'CurrentDate'].getValue()

You must have the full JavaScript name of the variable in a comment somewhere in the script, for example:

//VarCurrentDate

To see the variables that are detected in your script, look in the Variable Manager. For details, see Using the Variable Manager.

To insert existing variables into the HTML extension object:

  1. Do one of the following:

    The Properties ribbon is displayed.

  2. On the Properties ribbon, click Edit in the HTML Extension group. The Editor opens.

  3. Use the Insert: Variables list to select an existing variable and use the Items list to select the appropriate object on the page. The existing variable you select is added to the script.

  4. Click Save when you are finished editing the script.

The variables are associated with the HTML extension.

Knowledge Base | Training | Support
© Copyright ELB Learning 2023