Issue
TGML Graphic Alert: ReferenceError: "test" is not defined. (cmd#16)
Product Line
TAC Vista
Environment
- Vista 5
- TGML Graphic
Cause
A Javascript tag in the TGML has used a variable that has not been defined.
Resolution
- Determine which script tag is generating the error.
- When did the error occur? When the page loaded? When a value changed? When the user clicked? Did it happen once or multiple times? These questions can help you narrow down which script has thrown the error.
- Save the graphic under a different name. Delete portions of the graphic until the error clears. The component that was removed holds the offending script.
- The cmd# syntax is indicating which line of the script has the error. Launch the script editor by clicking the "..." button next to the script Content attribute. In this example, go to line 16 of the code.
- The variable name is in quotes. In this example, find where a variable named "test" was used.
- Verify that the variable has been declared and defined prior to being used.
Also check out the JavaScript Essentials - Programs and Statements Quick-Help video on the Exchange.