require of common helpers, Methods Webix Docs
functionoptional, a callback function master
objectoptional, the value to be passed as the this parameter
| promise | a "promise" object |
Example
webix.require("extras.js"); // "extras.css"
Details
The method is called only once. If you try to include the same module the second time, the command will be ignored.
To include several JS/CSS files, you can provide an array or an object as the first parameter of the method:
// including several files as an array
webix.require([
"file1.js",
"file2.js"
], function(){ /*callback*/ });
// including several files as an object
webix.require({
"file1.js": true,
"file2.js": true
}, function(){ /*callback*/ });
The difference between these two ways is the following:
- if the files are set in an array, the loading order is sequential: file2.js will be loaded after file1.js;
- if the files are set in an object, all js files are loaded at the same time and preserving the order of loading is not guaranteed.