JavaScript know its Lectora

approg
approg Community Member Posts: 250 ♪ Opening Act ♪
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?

Comments

  • mnotermans5114
    mnotermans5114 Community Member Posts: 916
    use a custom Lectora variable. For sure that will be undefined, null or 0 when not published with Lectora.
  • klaatu
    klaatu Community Member Posts: 988
    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.
Sign In or Register to comment.

So You Wanna Be An eLearning ROCKSTAR?

We're all fans of eLearning here! Want to become an eLearning ROCKSTAR? Just click on one of the buttons below to start your rocking journey!