Namespace Presto
Constructor Attributes | Constructor Name and Description |
---|---|
Method Attributes | Method Name and Description |
---|---|
<static> |
Presto.Console(expose)
Allows programmatic control of browser console for debugging. |
loadCSS(cssSrc)
Loads the CSS stylesheet specified by absolute or relative URL. |
|
loadLib(libName, version, useDocWrite)
Loads the JavaScript library specified by name and optional version, handling all dependencies. |
|
loadScript(scriptSrc, condition)
Loads the JavaScript library specified by absolute or relative URL. |
|
<static> |
Presto.namespace(namespace)
Registers the specified namespace. |
onLoadComplete(callback)
Fires when all load requests are complete. |
Allows programmatic control of browser console for debugging.
- Parameters:
- {String} expose
- The logging level to set for the console.
Loads the CSS stylesheet specified by absolute or relative URL. Relative URLs are relative to the path to the Presto JS Library Loader.
- Parameters:
- {String} cssSrc
- The URL to the CSS library to load.
Loads the JavaScript library specified by name and optional version, handling all
dependencies. This JS library must be configured in libraries-config.js
.
Loading can be handled on demand or by directly writing a <script> tag to the
DOM based on the useDocWrite
parameter. Direct writes ensure that loading
is handled synchronously, in a concrete order, but must occur before the DOM is fully
loaded. Loading on demand is asynchronous, providing better performance and can occur after
the DOM is loaded. On demand loading, however, does not guarantee any loading order.
- Parameters:
- {String} libName
- The configured name of the JavaScript library to load.
- {String} version
- Optionally, the specific version of this library to load. If omitted, the default version is loaded.
- {Boolean} useDocWrite
- Optionally, whether to directly write a <script> tag (true) or load this library on demand (false).
Loads the JavaScript library specified by absolute or relative URL. Relative URLs are relative to the path to the Presto JS Library Loader.
- Parameters:
- {String} scriptSrc
- The URL to the JavaScript library to load.
- {String or Function} condition
- The name of an object whose presence confirms this script is loaded. This can also be a function that returns a boolean value to confirm loading.
Registers the specified namespace.
- Parameters:
- {String} namespace
- The namespace to register.
Fires when all load requests are complete. This can occur before or after the DOM is fully loaded depending on whether loading was requested on demand. The configuration object passed to this method allows you to pass callback functions to handle successful loading or loading failures.
- Parameters:
- {Object} callback
- A configuration object with the following properties:
- {Function} callback.onSuccess
- A callback function to use when loading is successful. This
callback has a single
scope
parameter. - {Function} callback.onFailure
- A callback function to use when there are loading errors. This
callback has two parameters:
scope
,errors
. The errors property contains an error message. - {Object} callback.scope
- The object that defines the scope for callback methods. Typically "this".