Jam.py documentation

load_modules

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.

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
}