praveenpds
praveenpds

Reputation: 2936

How to include javascript while publishing as html in Adobe captivate 9

Im very much new to adobe captivate , and I had developed some tutorial using Captivate-9 and I want add some javascript code through Captivate editor , how to add ?

Upvotes: 0

Views: 1848

Answers (2)

David Wolf
David Wolf

Reputation: 1738

You can include custom JavaScript files by adding them to the Captivate template folder, which Captivate uses to generate your published project.

When you are on Windows, your Captivate installation path may be something like C:/Program Files (x86)/Adobe/Adobe Captivate CC 2019.

In that directory, there is a HTML folder, which is the "template" folder I mentioned earlier.

In that folder, you can drop a custom .js file. Under the assets directory should be a good place.

To actually load the script, you have to load it in the index.html file.

For that, locate the following code in the index.html file:

var lJSFiles = [ @JSFILES_ARRAY ];
cpXHRJSLoader.js(lJSFiles, function () {
  /* … */
});

And replace it with:

var lJSFiles = [ @JSFILES_ARRAY ];
lJSFiles.push('./assets/custom.js');
cpXHRJSLoader.js(lJSFiles, function () {
  /* … */
});

Make sure to update the path to your custom JavaScript file to fit your needs (./assets/custom.js in the example above).


Article about the topic: «How to add custom JavaScript to Adobe Captivate Projects».

Upvotes: 0

Related Questions