User defined variables and External JavaScript

andrew-robertson
Community Member Posts: 321 ♦ Idol ♦
Hi there - I am encountering a head scratcher. I am getting an uncaught error in the DEVTOOLS window of Chrome telling me that my user defined variable Var_userID is not defined. As you can see from my screenshot, the Var_userID is used a few times in my page2.html file so the it should be defined by the build.
I've tried my script in many areas, such as Top of file script, Bottom of file script, and even Header scripting.

I've tried my script in many areas, such as Top of file script, Bottom of file script, and even Header scripting.

Andrew R.
Developing content since 2010 using a mixed bag of tools.
Developing content since 2010 using a mixed bag of tools.
Answers
-
-
@timk that's a great trick to reset all variables. Now, I do have a TextBox that has an onShowAction that sets the content equal to _userID variable which is what puzzled me. I will give the reset all variables a go and report back.Andrew R.
Developing content since 2010 using a mixed bag of tools. -
Sad to report back that it didn't resolve my issue. I think there is a glitch somewhere in there. Either way, I went and acquired the variable via the code below directly in my JavaScript.
var tempUserID = AICC_Student_ID.getValue();
After doing it that way, I was able to get my module working fine.Andrew R.
Developing content since 2010 using a mixed bag of tools.
Categories
- 35.8K All Categories
- 109 ✫ Announcements
- 33.1K Lectora®
- 31.1K Lectora Discussions
- 28.9K Lectora Desktop
- 2K Lectora Online
- 2K Lectora Feature Requests
- 71 Lectora User Groups
- 36 Lectora Accessibility User Group (LAUG)
- 22 ELB Learning Content
- 22 ELB Learning Content Discussions
- 323 CenarioVR®
- 190 CenarioVR Discussions
- 133 CenarioVR Feature Requests
- 41 Rockstar Learning Platform®
- 38 Rockstar Learning Platform Discussions
- 108 CourseMill®
- 108 CourseMill Discussions
- 47 ReviewLink®
- 47 ReviewLink Discussions
- 7 The Training Arcade®
- 7 The Training Arcade Discussions
- 934 All Things eLearning
- 36 eLearning Development
- 546 Learning Management System (LMS) Integration
- 332 Web Accessibility
- 1.2K ♪ The Green Room
- 9 Additional Learning Products