domain: client
language: javascript
class AbstractItem
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.
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
}