Forum Discussion

DavidBaird-5911's avatar
DavidBaird-5911
Community Member
21 days ago
Solved

Javascript won't execute on one particular slide

I have one particular slide that won't execute JavaScipt.

I created a button which should show a JavaScript alert when pressed. It doesn't.

However, if I copy the button and paste it on another slide it works.

Any ideas? Could the slide be corrupt?

  • Sorry everyone...problem solved. There was a missing ( in the JavaScript. This error was stopping all other JavaScript running on the slide.

    let numSR = Number(player.GetVar"SR1"));
    
    should be...
    
    let numSR = Number(player.GetVar("SR1"));

    Lesson learnt, double check your syntax.😆

1 Reply

  • Sorry everyone...problem solved. There was a missing ( in the JavaScript. This error was stopping all other JavaScript running on the slide.

    let numSR = Number(player.GetVar"SR1"));
    
    should be...
    
    let numSR = Number(player.GetVar("SR1"));

    Lesson learnt, double check your syntax.😆