Javascript not working
Oct 12, 2017
I know Articulate doesn't provide JS support, but I know there are JS gurus out there. I am trying to use JS for a basic date and time. I am using the traditional JS:
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("SystemDate",dateString);
I set it up as an execute Javascript when timeline starts. I have done this a hundred times in Storyline 2. In this new program in 360, the text box where I put the variable SystemDate is empty. I appreciate your help!
3 Replies
Hi Kristi
I just tested your JS code, published and previewed in Chrome and it works for me - see Peek
Can you share the slide?
Thank you for testing that for me. I think it is like in class where you try it a hundred times and then the teacher comes over and it works because for whatever reason it works for me today too. I tried it for two days lol
Thanks Teach! :)
Ha ha - no worries Kristi.
This discussion is closed. You can start a new discussion or contact Articulate Support.