Captivate Javascript Comments Issue

Somewhere between Captivate 2017 and the present Captivate 2019 javascript comments in the Script_Window broke. Adobe has confirmed that this is a true bug.

While commenting on an Adobe Community question it was brought to my attention that javascript comments placed in the project Script_Window didn’t work. I was surprised and immediately tested this on the latest Captivate. Sure enough it was true, with some conditions.

First, if you leave out comments in your javascript there is no problem. This really isn’t good practice as commenting code is very useful when you come back to it some time later.

alert("This javascript code would work fine.");

Add in a single line comment and the javascript will not work.

// This is a single line comment anything on this line is ignored
alert("This javascript code will not execute in Captivate.");

What is interesting is the multiple line comment style does work.

/* This multiple line comment, even if on a single line it works */
alert("This javascript code would work fine.");

I’m not sure what is actually going on but it acts as if Adobe considers the Script_Window code to be a single line of javascript when executed. This might imply that you can’t get away with not having semi-colons between your statements either, though I haven’t tested that.

I’ll update this post if this ever gets fixed. Adobe isn’t particularly focused on fixing bugs, preferring to work on features.

>