Execute JavaScript trigger not working

Jun 10, 2020

Hi

Hopefully someone can help, I’m experiencing some strange behaviour with an execute JavaScript trigger in Storyline 360. If I publish and test the appropriate slide ('details' slide in attached file) on its own, the trigger is executed (I’ve got an ‘alert’ as the first line of the JavaScript) but when I publish the whole course it doesn’t.

The trigger should execute when the user clicks on the calendar icon on the third slide.

Thanks

Paul

5 Replies
Darren Heath

*UPDATE*

Commenting out the Execute JS script on slide 4 seems to resolve the issue and the calendar script functions accordingly

It's no consolation Paul, but i am getting exactly the same errors as you are. It isnt the script, is even a simple alert script, or random number script isnt working either.

Ive tried triggering the JS when a variable changes, when the timeline reaches 0.5s, at timeline start, and even on button click, still nothing. 

Ive tried importing the slides into a clean storyline file to see if that wipes out any corruptions that may lie within the file but still the same outcome.

I then deleted everything apart from the calendar slide, and the JS executed as planned. I then added the title slide and slide 2 and the JS was still working.

After I added the the 4th slide to set LMS string it is at this point when things fell over.  

Ive not looked into that slide in detail yet but hope that gives you a little bit of help for where to look at where the bug may be. 

Stacy Springer

Any help would be appreciated! My Execute Javascript trigger is not working. Here is my code (which has worked in the past:

// Step 1. Connect JavaScript to the Storyline variables
var player = GetPlayer();
var FirstName = player.GetVar("FirstName");
var LastName = player.GetVar("LastName");
var Email = player.GetVar("Email");
var CEONotes = player.GetVar("CEONotes");
var CEOSkills = player.GetVar("CEOSkills");
var CEOTeam = player.GetVar("CEOTeam");


// Step 2. The HTML Section - with the Storyline variables inserted
var contents = "<html><head></head><body style='width:650px;padding:20px;'>";
contents+="<div style='font-size:26px;font-weight:bold;margin-top:26px;margin-bottom:20px;'>Meet the Teams Activity</div>";
contents+="<div style='font-size:22px;font-weight:bold;margin-top:26px;margin-bottom:20px;'>Instructions - Print Your Answers to PDF and email to the instructor</div>";
contents+="<div style='display:block;border-width:1px';><hr/></div>";
contents+="<div style='font-size:16px;font-weight:bold;'>Student Information</div>";
contents+="<p>"+FirstName+" "+LastName+" "+Email+"</p>";
contents+="<div style='display:block;border-width:1px';><hr/></div>";

contents+="<div style='font-size:16px;font-weight:bold;'>CEO Job Skill Rating</div>";
contents+="<p>"+CEOSkills+"</p>";
contents+="<div style='font-size:16px;font-weight:bold;'>CEO Team Player Rating</div>";
contents+="<p>"+CEOTeam+"</p>";
contents+="<div style='font-size:16px;font-weight:bold;'>CEO Notes</div>";
contents+="<p>"+CEONotes+"</p>";
contents+= "</body></html>";

// Step 3. Open the document window, write the HTML contents, and open the print window
var myWindow = window.open("","Print","width=810,height=610,scrollbars=1,resizable=1");
myWindow.document.write(contents);
myWindow.print();