HOME ➔ SUPPORT ➔ Community ➔ General CourseLab issues ... passing variables to javascript
passing variables to javascript
  View type:
Hi Folks,

Sorry to keep asking questions but, does anyone know of a way to pass variables to javascript.

What I have to do is pass the users name into javascript to be saved into a database.

I'm not allowed to use a freebie LMS such as moodle or docebo, my preferred choice.

Thanks,

Dave
 
Hi, David,

CourseLab variables are actually stored in JavaScript collections: g_arVars and g_arSlideVars (first - for global vars, second - for slide scope vars). I.e. for variable named "myvar" and scope "global" in JavaScript it can be found as: g_arVars["myvar"].
Subject:
Message options
No additional options