Previous
Previous
 
Next
Next


ADD_LIBRARY Procedure

This procedure adds the script tag to load a JavaScript library. If a library has been added it will not be added a second time.

Syntax

APEX_JAVASCRIPT.ADD_LIBRARY (
    p_name           IN VARCHAR2,
    p_directory      IN VARCHAR2 DEFAULT wwv_flow.g_image_prefix||'javascript/',
    p_version        IN VARCHAR2 DEFAULT c_apex_version,
    p_skip_extension IN BOOLEAN DEFAULT FALSE);

Parameters

Table: ADD_LIBRARY Parameters describes the parameters available in the ADD_LIBRARY procedure.

ADD_LIBRARY Parameters

Parameter Description

p_name

Name of the JavaScript file. Must not use .js when specifying.

p_directory

Must have a trailing slash.

p_version

Version identifier. It is recommended, but is optional, to add this to the library name.

p_skip_extension

If TRUE the extension .js is NOT added.


Example

The following example includes the JavaScript library file my_library.1.2.min.js in the directory specified by p_plugin.file_prefix. This is the recommended syntax when you include your own JavaScript files in a plug-in.

apex_javascript.add_library (
    p_name      => 'mylibrary.1.2.min'
    p_directory => p_plugin.file_prefix,
    p_version   => null );