Explore the community Forums Lectora Lectora Questions & Answers JavaScript know its Lectora

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #412929 Score: 0
    Profile photo of approg
    approg
    Member
    beginner
    intermediate
    curious george
    wise owl
    contributor
    friend finder
    picture perfect
    18 pts
    @approg

    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?

    #412933 Score: 1
    Profile photo of Math Notermans
    Math Notermans
    Member
    contributor
    intermediate
    advanced
    friend finder
    junior moderator
    advocate
    LUC16 Attendee
    LUC16
    wise owl
    curious george
    106 pts
    @mnotermans5114

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

    This post has received 1 vote up.
    #413008 Score: 2
    Profile photo of Darrel Somoza
    Darrel Somoza
    Member
    contributor
    friend finder
    beginner
    intermediate
    junior moderator
    advanced
    wise owl
    curious george
    profile
    192 pts
    @Klaatu

    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.

    This post has received 2 votes up.
Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.