This procedure adds the script tag to load a JavaScript library. If a library has been added, it is not added a second time.
Syntax
APEX_JAVASCRIPT.ADD_LIBRARY ( p_name IN VARCHAR2, p_directory IN VARCHAR2, p_version IN VARCHAR2 DEFAULT NULL, p_check_to_add_minified IN BOOLEAN DEFAULT FALSE, p_skip_extension IN BOOLEAN DEFAULT FALSE, p_ie_condition IN VARCHAR2 DEFAULT NULL, p_key IN VARCHAR2 DEFAULT NULL);
Parameters
Table 13-7 describes the parameters available in the ADD_LIBRARY
procedure.
Table 13-7 ADD_LIBRARY Parameters
Parameter | Description |
---|---|
|
Name of the JavaScript file. Must not use |
|
Directory where JavaScript library is loaded. Must have a trailing slash. |
|
Version identifier. |
|
If TRUE, the procedure tests if it is appropriate to add |
|
If TRUE the extension |
|
Condition which is used as Internet Explorer condition. |
|
Name used to indicate if the library has already been loaded. If not specified, defaults to |
Example
The following example includes the JavaScript library file named my_library.1.2.min.js
(if the application is not running in DEBUG mode), or my_library.1.2.js
(if the application is running in DEBUG mode), from the directory specified by p_plugin.file_prefix
. The addition of the .min
extension if the application is not running in DEBUG mode is carried out because p_check_to_add_minified
is set to true. Since p_skip_extension
is not specified, this defaults to .js
. Also, since p_key
is not specified, the key defaults to p_plugin.file_prefix||mylibrary.1.2
.
apex_javascript.add_library ( p_name => 'mylibrary.1.2', p_directory => p_plugin.file_prefix, p_check_to_add_minified => true );