Forum Discussion

1Articulate's avatar
1Articulate
Community Member
7 months ago
Solved

java script not definied

Hello community, I have the following problem with an older training file and JavaScript. We want to use JavaScript in our training files. This is very easy in Storyline. I created and saved a ...
  • Nathan_Hilliard's avatar
    7 months ago

    That often means there is some syntax error such as mismatched quotes, braces, parentheses, etc. Is the alert statement above copied directly from your script, or did you retype it? Make sure the quotes are actually plain quotes, not the curly quotes you often get when copying text from Word or the web. 

    Try disabling the script containing that statement and see if it works without error to make sure the error is actually there and not somewhere else. 

    Try starting over with the original working project file and add only small bits of javascript to ensure each piece works before adding more if you have troube narrowing it down.

    Also, try pasting your JS code into https://jshint.com/ to check for erorrs before putting it into you SL trigger.