Turn off javascript error when previewing scenes?

I heavily use Javascript triggers in my courses... every screen has one to send a "page view" to Google Analytics. 

Whenever I preview slides or scenes in these courses during development, I get an error message on every screen alerting me that "javascript support is not available while previewing." This isn't so much of an issue, aside from the nuisance of having to dismiss the error on Every. Single. Screen. 

Normally what happens in these instances is that the timeline is counting down in the background as soon as the screen launches, although I can't see any of the timeline's associated actions until I dismiss the javascript error. So if it takes me 2 seconds to dismiss the message, then the screen immediately jumps to the 2-second mark in the timeline and picks up from that point.

My current issue is with screens that have audio. While everything else might pick up at the 2-second point when I dismiss the javascript error, the audio starts at the beginning which completely throws off the timing of anything I have set to be in sync with certain points in the audio. This makes it impossible to accurately preview anything with both javascript and audio unless I actually publish the course. (Edit to add: this problem with the audio not starting in sync with the rest of the screen after I dismiss a javascript error is inconsistent. On some screens it starts in sync and on others it does not.)

My question: Is there ANY way to suppress this pop-up javascript error message during preview mode so that I can accurately preview these screens?

12 Replies
Ashley Terwilliger

Hi Monique,

There isn't a way to turn it off - but I did see a user share a workaround the other day to set up the javascript triggers to fire based on the condition that X is equal to true...since it's just a false variable not actually used or referenced anywhere, it's never going to be true and therefore the Javascript won't execute. It's a bit to set up and remove if you have Javascript on every page so hopefully one of our other users will chime in here with additional ideas. 

Jeffrey Riley

The problem I am having is the message pops up and eventually stops the program from running. There should be a better solution than this. I don't see why the message pops up all the time and I already know javascript does not run in preview. 

When a message starts interfering with a program, that message is now a problem. I don't think we should have to get around something like this. Hope there is a better solution at some point.

OWEN HOLT

I have sometimes used the solution noted above if I know I will have a lot of javascript in a project.

I add a variable called preview with a default value of True. 
All of my JS triggers have a condition to run IF Preview is = to False. This essentially disables all the JS for preview during development.
Anytime I want to publish to test the script as well, I simply change the variable's value to False and publish. I don't have to change any JS since the condition on the trigger will now allow it to fire.

It's a work around for functionality that I too wish was there, but it isn't a complex one.

Jeffrey Riley

Thanks Owen, I looked at that solution earlier but could not find it again. So I must also change every JS trigger to have this condition. Probably easier as you build them. In this case, I will have to open all of them and add the condition. 

I sure don't remember this as a problem several years back but maybe I was not using much javascript. Thanks and I will get  to work.