Loader
(
o
)
- Parameters:
-
o <object>
an optional set of configuration options. Valid options:- base: The base dir
- comboBase: The YUI combo service base dir. Ex: http://yui.yahooapis.com/combo?
- root: The root path to prepend to module names for the combo service. Ex: 2.5.2/build/
- filter:
A filter to apply to result urls. This filter will modify the default
path for all modules. The default path for the YUI library is the
minified version of the files (e.g., event-min.js). The filter property
can be a predefined filter or a custom filter. The valid predefined
filters are:
- DEBUG
- Selects the debug versions of the library (e.g., event-debug.js). This option will automatically include the Logger widget
- RAW
- Selects the non-minified version of the library (e.g., event.js).
myFilter: { 'searchExp': "-min\\.js", 'replaceStr': "-debug.js" }
- filters: per-component filter specification. If specified for a given component, this overrides the filter config
- combine: Use the YUI combo service to reduce the number of http connections required to load your dependencies
- ignore: A list of modules that should never be dynamically loaded
- force: A list of modules that should always be loaded when required, even if already present on the page
- insertBefore: Node or id for a node that should be used as the insertion point for new nodes
- charset: charset for dynamic nodes (deprecated, use jsAttributes or cssAttributes)
- jsAttributes: object literal containing attributes to add to script nodes
- cssAttributes: object literal containing attributes to add to link nodes
- timeout: The number of milliseconds before a timeout occurs when dynamically loading nodes. If not set, there is no timeout
- context: execution context for all callbacks
- onSuccess: callback for the 'success' event
- onFailure: callback for the 'failure' event
- onCSS: callback for the 'CSSComplete' event. When loading YUI components with CSS the CSS is loaded first, then the script. This provides a moment you can tie into to improve the presentation of the page while the script is loading.
- onTimeout: callback for the 'timeout' event
- onProgress: callback executed each time a script or css file is loaded
- modules: A list of module definitions. See Loader.addModule for the supported module metadata
- groups: A list of group definitions. Each group can contain specific definitions for base, comboBase, combine, and accepts a list of modules. See above for the description of these properties.
- 2in3: the version of the YUI 2 in 3 wrapper to use. The intrinsic support for YUI 2 modules in YUI 3 relies on versions of the YUI 2 components inside YUI 3 module wrappers. These wrappers change over time to accomodate the issues that arise from running YUI 2 in a YUI 3 sandbox.
- yui2: when using the 2in3 project, you can select the version of YUI 2 to use. Valid values are 2.2.2, 2.3.1, 2.4.1, 2.5.2, 2.6.0, 2.7.0, 2.8.0, and 2.8.1 [default] -- plus all versions of YUI 2 going forward.