JavaScript know its Lectora

We're getting a HTML5 interaction build for us that I intend to incorporate into a Lectora title. One of my colleagues also wants to use the interaction in their non-Lectora course.

I've written some JavaScript that allows for communication with the Lectora title but it mustn't run in the non-Lectora course. Is there an robust, accurate way for JavaScript to know if the course is a Lectora course?

Discussion (2)

Thinking along the same lines as Math, you can check to see if CurrentPageName exists. This Lectora reserved variable will exist in all Lecotra lessons making it backwards compatible and doesn't require creating a variable.

use a custom Lectora variable. For sure that will be undefined, null or 0 when not published with Lectora.

Discussions have been disabled for this post