JavaScript trigger not triggering in 2.5. Works in 2.4.

Jun 01, 2015

We are creating Web based versions of some courses. Within this course, on the entry of the last slide, we are inserting a javascript snippet. With Storyline 2.4, this code is called and reaches back to our application. With Storyline 2.5, this code is not called. I verified this via Chrome's Inspect Element.

I've tested 20 courses. 9 published with 2.4 (worked) and 11 published with 2.5 (didn't work). We'd like our team of 5 to all use 2.5 and need to figure out what the difference is between 2.4 and 2.5 so the courses can be published in 2.5 and our code gets called.

Has anybody else experienced this issue?

27 Replies
Ashley Terwilliger-Pollard

Hi Morgan, 

That link did not bring me to an active thread - but yes, Update 6 of Storyline 2 deals with the issues of content not being displayed while viewing in Chrome Version 44 and using HTML5. You can read about that here and for previously published courses, a few additional fixes while our team works on an updater. 

Ashley Terwilliger-Pollard

Sorry for my confusion Morgan - you referenced the other thread so I wasn't sure. Update 6 was an emergency type of patch based on the Chrome/HTML5 issue so no it doesn't include that fix. You can always see what elements were included in an Update by reading the release notes here.  Also when you have an open case with our Support team we'll send you an update via email about any updates which resolve the issue and we'll post in the appropriate forum threads as well.

Thanks for reaching out and let us know if you need anything else. 

Morgan Walker

Hello Ashley,

I'm looking through https://www.articulate.com/support/storyline-2/issues-addressed-in-the-latest-articulate-storyline-2-update/ and it seems like this issue wasn't fixed in 2.7 either.  Can you confirm?  If it wasn't fixed in 2.7, where is this issue on your roadmap?

Thanks,
Morgan

Ashley Terwilliger-Pollard

Hi Morgan,

Thanks for checking in here. Did you receive the email that John Say sent on October? I've copied it below:

I am writing to update you on the status of your previous report about javascript not working in Storyline. We were previously unable to reproduce the issue on our end. We do not support troubleshooting javascript code. Today, using Articulate Storyline 2 update 7, I edited your course to add a simple javascript popup to the last slide in order to test if simple javascript codes can work within the slide. I uploaded the published course to our server. You can access the course here: 

[link removed]

The javascript pop-up does appear on the last slide, suggesting that javascript does work on the published course. Can you please try to install the latest version of Articulate Storyline 2 and see if the javascript will work on your end? 

Please make sure that you have the latest version of Articulate Storyline 2 installed which is Storyline 2 update 7. In Articulate Storyline, go to Help > About Articulate Storyline. 

As John mentioned we can't support Javascript code, but it seems that code in general is working in Storyline 2 update 7 - so you'll want to look at using the latest update. I do see that the issue is still with our team but I'm unable to offer a time frame in regards to a fix or status update for the issue so I'd look at using Storyline 2 Update 7 going forward and if you'd like share the Javascript code in the forums so that others in the community can take a look. 

Morgan Walker

With 2.7, we tried to load the JS upon opening the last slide of the course but it still didn't fire off.  Here is the JS:

 

function ExecuteScript(strId)
{
switch (strId)
{
case "6AB7HXMAODd":
Script1();
break;
}
}

function Script1()
{
parent.postMessage('Course Completed', 'http://localhost:5000');
parent.postMessage('Course Completed', 'https://epic.myteachstone.com');
parent.postMessage('Course Completed', 'https://epic2.myteachstone.com');
parent.postMessage('Course Completed', 'https://qat.myteachstone.com');
parent.postMessage('Course Completed', 'https://int.myteachstone.com');
parent.postMessage('Course Completed', 'https://www.myteachstone.com');
parent.postMessage('Course Completed', 'https://myteachstone.com');
parent.postMessage('Course Completed', 'https://agility.myteachstone.com');
parent.postMessage('Course Completed', 'https://prod.myteachstone.com');
}

 

So it seems this still only works in 2.4.  Is there anything you can do to help us out?  We'd really like to move to 2.7.  Is there a workaround or anything you can suggest?

Christie Pollick

Hi, Morgan -- Many thanks for the update, and as Ashley had indicated, we are unable to provide support for JavaScript coding. Luckily, we have lots of community members who are more than willing to share their expertise, so we will need to defer to them to assist you further with specifics. 

And for those who'd like to review it, here is a sheet on JavaScript Best Practices that it never hurts to keep handy. :)

PRAKASH B

Hi Morgan Walker,

Do you  have any patch file for running this code. For example if you get tincan statement in your course you must include the tincan.js or tincan.min.js file  to your story.html file like..

<script SRC="story_content/user.js" TYPE="text/javascript"></script>
<script src="story_content/story.js" type="text/javascript"></script>
<script src="tincan-min.js"></script>

so if you you have this kind of files you must want to include your output.

Morgan Walker

Thanks for responding, Prakash!  What I pasted above is the contents of our user.js file.  story.html has:

<script SRC="story_content/user.js" TYPE="text/javascript"></script>
<script src="story_content/story.js" type="text/javascript"></script>

but my story_html5.html file doesn't have that.  Do you think it would be worth adding it there?

This discussion is closed. You can start a new discussion or contact Articulate Support.