Skip to main content
sharonhuston23
Known Participant
July 10, 2019
Answered

Need Basic Help with moduleReadyEvent

  • July 10, 2019
  • 4 replies
  • 573 views

I can't get the moduleReadyEvent to fire. I know I'm doing something stupid, but I've been fussing with this for hours now and could really use some help.

I'm on Captivate 11.0.1.266, publishing as HTML5 only.

This code is on my first slide, using an On Enter action.

The time shows in the console (10:34 am), so I know the code works.  The success message never appears.

window.addEventListener("moduleReadyEvent", function evtFunc(evt)

{

console.log("success");

});

console.log("10:34 am");

What am I missing?

    This topic has been closed for replies.
    Correct answer Stagprime2687219

    To address the moduleReadyEvent... try this...

    window.addEventListener("moduleReadyEvent", function(evt)

    {

        var interfaceObj = evt.Data;

        var eventEmitterObj = interfaceObj.getEventEmitter();

    },

    console.log("success")

    );

    4 replies

    Stagprime2687219
    Stagprime2687219Correct answer
    Legend
    July 10, 2019

    To address the moduleReadyEvent... try this...

    window.addEventListener("moduleReadyEvent", function(evt)

    {

        var interfaceObj = evt.Data;

        var eventEmitterObj = interfaceObj.getEventEmitter();

    },

    console.log("success")

    );

    sharonhuston23
    Known Participant
    July 10, 2019

    Brilliant, this totally worked.  Thank you!!

    Inspiring
    July 15, 2019

    Strange to me that you got it to work by running that code in an 'OnEnter' action on the first slide.

    My understanding was that it has to be ran from index.html or some external js file as the moduleReadyEvent fires long before any OnEnter action gets triggered?!

    Maybe some js guru can chime in and explain?

    Stagprime2687219
    Legend
    July 10, 2019

    How about trying this method...?

    $(document).ready(function() {
    console.log("success");
    });