events - Events API

Event Options

This article describes the Event options that can be set on initialisation and details how the Events API can be provided with function callbacks for certain events.

description Function to be called when Events API has been successfully initialised.
type function
default -
arguments -

readyListener example

   readyListener: function() {
        console.log("Learnosity Events API is ready");
    },
description Function to be called on a Learnosity error event.
type function
default -
arguments object

errorListener example

    errorListener: function(e) {
        console.log(e);
    },

    /* example object
    {
        code: 10000,
        msg: "Failed to load report data"
    }
    */
};

var eventsApp = LearnosityEvents.init(initOptions, eventOptions);
Was this article helpful?

Did you arrive here by accident? If so, learn more about Learnosity.