• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Common JS Interface - Captivate 8 (pulling content from an html file)

New Here ,
Oct 01, 2015 Oct 01, 2015

Copy link to clipboard

Copied

I have hit a stop on the ComonJS interface (window.cpAPIInterface.setVariableValue), and what should be relatively simple, I'm having difficulties with. I can't get the name to render. This is what I have:

In my Captivate published HTML file, in the <head> section, I set the following variable "learner", and define the function setLearnerName() function as:

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<title></title>

<script src="standard.js" type="text/javascript"></script><script>

<script>

  var learner = "MyName;

  function setLearnerName(){

     window.cpAPIInterface.setVariableValue("learner_name", learner);

}

</script>

</head>

In my Captivate file in the Script Window, I simply call the function: "setLearnerName();" and do nothing else.


Yet, when I run on my server the published version, the output is blank, and not "MyName".


Can anyone advise me on what to do to get the variable set in the HTML file to that of the Captivate Caption output? I used this article as a reference: Common JS interface


Thanks for your time.

Bibi

TOPICS
Advanced

Views

369

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Oct 02, 2015 Oct 02, 2015

Copy link to clipboard

Copied

LATEST

You're missing a closing quote setting "learner":

var learner = "MyName";

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Help resources