Legacy Documentation
You are using the documentation for version 3.5.17. Go here for the latest version or check here for your available upgrades to the latest version.
Javascript Class¶
Class Reference¶
-
class
EE_Javascript
¶ The library is loaded using the following code:
ee()->load->library('javascript');
-
EE_Javascript::
set_global
($var[, $val = ''])¶ Parameters: - $var (string) – The variable name to add to the EE javascript object
- $val (string) – The value of the variable being added
Return type: void
Add a variable to the EE javascript object. Useful if you need to dynamically set variables for your external script. Will intelligently resolve namespaces (i.e.
filemanager.filelist
) so please use them.
-
EE_Javascript::
compile
([$view_var = 'script_foot'[, $script_tags = TRUE]])¶ Parameters: - $view_var (string) – The element to attach the foot to
- $script_tags (boolean) – Set to
TRUE
to output the<script>
tags, otherwise doesn’t add them
Return type: void
Gather together all scripts needing to be output for the given
$view_var
.
-
EE_Javascript::
get_global
()¶ Returns: The HTML markup containing our JS Return type: string Prepares and returns the HTML+JS for injecting variables into the EE namespace.
-
EE_Javascript::
script_foot
()¶ Returns: The HTML markup containing our foot JS Return type: string Prepares and returns the JS to be output in the foot.