My Javascript in Storyline 2 works locally but not online

I've got a short piece of Javascript in a proof of concept module that works when I publish it to my PC and run story_html5.html  but doesn't work when I upload it to the web.

It tests the user input for the first part of a URL by stripping out all but the first 24 characters, putting that in a variable 'newsub' and then triggering on the value of 'newsub'.  Newsub has a default value of 'wasthisbeforeentry' to check whether it's being changed.

The code is 

var player =GetPlayer();
var a = player.GetVar("TextEntry1");
var a = a.slice(0,24)

There's a test version at

If you want to test it the 'correct' string is

Screen 2 displays both TextEntry1 and newsub.  It shows that newsub isn't getting changed as in the last line of Javascript.  Yet this same module works perfectly in the published version my local PC.

I've tried different browsers, it's the same in them all.  Can anyone advise me on where I'm going wrong? (This is Storyline 2)



2 Replies