customUnload - Initialization - Items API

Items API Initialization

customUnload()

This function is called when the learner attempts to close the browser window.

You would want to specify this callback so that you can display a custom error notification or dialog in order to warn the learner that they may lose their progress if they don't save, for example.

Examples

var callbacks = {
    customUnload: function () {
        console.log('The callback that is executed when the learner attempts to close the browser window.');
    },
    // ...
};

var itemsApp = window.LearnosityItems.init(
    initializationOptions,
    callbacks
);

Arguments

None.

Return value

None (undefined).

Related articles

Was this article helpful?

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