includes and caches a JS/CSS module(s)
url | string|array|object | the path to a JS/CSS file(s) |
callback | function | optional, a callback function |
master | object | optional, the value to be passed as the this parameter |
promise | a "promise" object |
webix.require("extras.js"); // "extras.css"
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: