Passing Lectora Var to JavaScript

I have one page with three items on it, Greg.


Here's what I have...


Item 1 - An ACTION that sets (using Modify Variable - Set Variable Contents) "_LectoraVariable" with the value "Here is stuff". This works just fine. The variable does contain the value.


 


Item 2 - A text block that has four ACTIONS


1-Set a variable with the string "The Lectora value is..."


2-Add to the variable the value of "_LectoraVariable"


3-Pass the variable value to the text block


4-Display (Show) the text block. 


All this works fine. The string is properly displayed on the screen.


 


Item 3 - An External HTML Object (Other) with the below JS code.


Var_LectoraVariable.setByVar(Var_LectoraVariable);
var JSVariable = Var_LectoraVariable.value;
document.write ("The Lectora value from JS is...");
document.write (Var_LectoraVariable.value + "
");
document.write ("The JavaScript value is...");
document.write (JSVariable);


This is the problem area. The two "document.write" statements display the strings correctly but the Lectora and JS variables display as "0".


 


Does anything jump out as wrong with all of this?

Discussions have been disabled for this post