CourseLab CourseLab 3.5. User's Guide Previous topic Next topic

Accessing CourseLab variables via JavaScript

Direct variable reference can be used in JAVASCRIPT action or in custom functions. CourseLab variables are stored in 2 global objects (according to variable's scope):

  1. CLV.oGlobal - contains variables with "whole module" scope,
  2. CLV.oSlide - contains variables with "current slide" scope. This object is renewed on every slide transition.

The example of setting the value of variable newvar with "current slide" scope:

CLV.oSlide["newvar"] = 12;

Older CourseLab 2.7 variable names are also supported for compatibility purposes (g_arVars, g_arSlideVars).