Forum Discussion
Storyline 360 Review Feature supports Javascript?
Hi, I'm having same issue - java script suddenly not working in review (haven't published to test as scorm file yet - but I need it to work in Review)
I use latest version of Storyline360 and Chrome as browser. Have also tested in Microsoft Edge.
My modern player was changing colour perfectly according to java script shown below. Very chuffed with myself.
I got creative and wanted to add an 'send self an email' into the mix and have the body of the email populate with the variables they had chosen. It was fantastic and working when I tested one variable so I went on to add them all in.
On next publish both sets of java script simply do not work.
I contacted our IT division to see if it was something in the security settings controlled by the organisation and they said no and that they're not able to help with java script programming.
Help! Anyone!
Here's the script that changed the player:
if(void 0===window.stencil360player){window.stencil360player=!0;var player=GetPlayer(),xhttp=new XMLHttpRequest,targlink="https://cluelabs.com/stencil/display/widget-slplayer-display?v=1614909087&chart=NTc5fDE3ODd8MjYzODljMWIzNjliYzVjNDFjNzk5NzM2Y2UzODMwMjE";xhttp.onreadystatechange=function(){if(4==this.readyState&&200==this.status&&""!=this.responseText){var e=document.getElementsByTagName("head")[0],t=document.createElement("style");e.appendChild(t),t.appendChild(document.createTextNode(this.responseText)),player.SetVar("stencilrendered",parseInt(player.GetVar("stencilrendered"))+1)}},xhttp.open("GET",targlink,!0),xhttp.send()}
Here's the script that sent the email:
var player = GetPlayer();
var email=player.GetVar("email");
var subject="Leadership characteristics to work on";
var body_start=player.GetVar("TextEntryCommit1"%0D"TextEntryCommit2"%0D"TextEntryCommit3"%0D"TextEntryCommit4"%0D"TextEntryCommit5"%0D"TextEntryCommit6"%0D"TextEntryCommit7"%0D"TextEntryCommit8"%0D"TextEntryCommit9"%0D"TextEntryCommitten"%0D"TextEntryCommit11");
var mailto_link='mailto:'+email+'?subject='+subject+'&body='+escape(body_start);
win=window.open(mailto_link,'emailWin');
I've attached the sample slide if anyone cares to have a look. Apologies for the crazy amount of variables.
The java script for the player is on the master slide
Hi Sharon,
Your code had quite some errors. Variables you can get only one at a time...and then some more mistakes in the javascript. Javascript does work properly in Review.
Check here... mail works as planned...
https://360.articulate.com/review/content/1dd5de5f-027c-4a76-b14f-d6b35f261d60/review
Adding the fixed Storyline.
When working with Javascript. DO NOT USE Storyline as your javascript editor. Get a quality Javascript editor like Sublime Text or Brackets. The color coding in there helps to find errors quickly.
- SharonGoza5 years agoCommunity Member
I think you meant Katherine.