Initialization Option Author API

readyListener

This function is called when the API has been successfully initialized.

You would want to use this callback so that you can run your own application logic after Author API has completed loading, such as adding event listeners for Author API Events or injecting additional content into the page, for example.

Examples

var callbacks = {
    readyListener: function () {
        console.log('The callback that is executed when the API has been successfully initialized.');

        // Example event listener that runs when a widget will be added to an Item
        authorApp.on('add:widget', function () {
            console.log('A Widget will be added to the Item.');
        });
    },
    // ...
};

var authorApp = window.LearnosityAuthor.init(
    initializationOptions,
    callbacks
);

Values

Type function

Related articles

Was this article helpful?