Forum Discussion

SunilDhakad's avatar
SunilDhakad
Community Member
9 hours ago

ExecuteScript its not working after reload/refresh in trigger.js

Hi,

We have recently upgrade the storyline latest version (Build 3.92.33293.0) and we seems some changes in javascript. Earlier we had only user.js file to each slide script calling for jump on other slides. but after upgrade we can see the ExecuteScript moved to seperate file which is trigger.js file to execute the script on case basis. we noticed that trigger.js file having ExecuteScript calling only once while we cached clear and page reload but second time we just reload page its doesn't calling ExecuteScript from trigger.js file. 

we have added alert into ExecuteScript function it gives prompt on first time only. Can you please look into it and provide the solutions?

  • SusanDiana's avatar
    SusanDiana
    Community Member

    I think the issue because the latest version runs your script inside another function. Which means your variables and functions are scoped to only be available inside that function. A solution to work around this is to create/assign them in the window scope. So something like this:

    window.myFunction = function(){
    // ... your function
    }