load_modules

AbstractItem.load_modules(module_array, callback)
Domain:

client

Language:

javascript

Class:

AbstractItem()

Description

Use load_modules method to dynamically load specified modules before executing the callback.

The method works the same way as load_module, only loads and initializes all modules of items specified in the module_array.

Parameters

Parameter

Type

Description

module_array

array

The list of modules to load and initialize.

callback

function

Example

Bellow, the do_some_work function is executed only when modules of the item and its owner has been loaded:

function some_work(item) {
    item.load_modules([item, item.owner], do_some_work);
}

function do_some_work(item) {
    // some code
}

See also

Related functions

Related concepts