Forum Discussion
EmilieMartin
4 years agoCommunity Member
Javascript not activating in Storyline-(showing only default value)
Hello,
I am trying to get a basic date to generate using JavaScript. I have everything set up and when published it only shows the default value. Please help.
Here is the code I am using:
<s...
RussellKillips-
4 years agoCommunity Member
Your script is missing semicolons.
var currentTime = new Date();
var month = currentTime.getMonth() + 1;
var day = currentTime.getDate();
var year = currentTime.getFullYear();
var dateString=month + "/" + day + "/" + year;
var player = GetPlayer();
player.SetVar("TodayIs",dateString);
player.SetVar("month",month);
player.SetVar("day",day);
player.SetVar("year",year);