Class CI_Javascript - echiong/testRepo GitHub Wiki

##Class CI_Javascript

Javascript Class

	###Direct known subclasses
		<a href="Class CI_Jquery.md">CI_Jqueryggg</a>

Package: [[CodeIgniter<a href="Package CodeIgniter.Libraries.md">Libraries]]
Category: Javascript
Author: ExpressionEngine Dev Team
Link: http://codeigniter.com/user_guide/libraries/javascript.html
Located at system/libraries/Javascript.php

##Methods summary


public __construct ( mixed $params = array() )


public string blur ( string $element = 'this', string $js = '' )

Blur

Outputs a javascript library blur event

Parameters

$element string
The element to attach the event to

$js string
The code to execute

Returns string


public string change ( string $element = 'this', string $js = '' )

Change

Outputs a javascript library change event

Parameters

$element string
The element to attach the event to

$js string
The code to execute

Returns string


public string click ( string $element = 'this', string $js = '', boolean $ret_false = TRUE )

Click

Outputs a javascript library click event

Parameters

$element string
The element to attach the event to

$js string
The code to execute

$ret_false boolean
whether or not to return false

Returns string


public string dblclick ( string $element = 'this', string $js = '' )

Double Click

Outputs a javascript library dblclick event

Parameters

$element string
The element to attach the event to

$js string
The code to execute

Returns string


public string error ( string $element = 'this', string $js = '' )

Error

Outputs a javascript library error event

Parameters

$element string
The element to attach the event to

$js string
The code to execute

Returns string


public string focus ( string $element = 'this', string $js = '' )

Focus

Outputs a javascript library focus event

Parameters

$element string
The element to attach the event to

$js string
The code to execute

Returns string


public string hover ( string $element = 'this', string $over, string $out )

Hover

Outputs a javascript library hover event

Parameters

$element string
- element

$over string
- Javascript code for mouse over

$out string
- Javascript code for mouse out

Returns string


public string keydown ( string $element = 'this', string $js = '' )

Keydown

Outputs a javascript library keydown event

Parameters

$element string
The element to attach the event to

$js string
The code to execute

Returns string


public string keyup ( string $element = 'this', string $js = '' )

Keyup

Outputs a javascript library keydown event

Parameters

$element string
The element to attach the event to

$js string
The code to execute

Returns string


public string load ( string $element = 'this', string $js = '' )

Load

Outputs a javascript library load event

Parameters

$element string
The element to attach the event to

$js string
The code to execute

Returns string


public string mousedown ( string $element = 'this', string $js = '' )

Mousedown

Outputs a javascript library mousedown event

Parameters

$element string
The element to attach the event to

$js string
The code to execute

Returns string


public string mouseout ( string $element = 'this', string $js = '' )

Mouse Out

Outputs a javascript library mouseout event

Parameters

$element string
The element to attach the event to

$js string
The code to execute

Returns string


public string mouseover ( string $element = 'this', string $js = '' )

Mouse Over

Outputs a javascript library mouseover event

Parameters

$element string
The element to attach the event to

$js string
The code to execute

Returns string


public string mouseup ( string $element = 'this', string $js = '' )

Mouseup

Outputs a javascript library mouseup event

Parameters

$element string
The element to attach the event to

$js string
The code to execute

Returns string


public string output ( string $js )

Output

Outputs the called javascript to the screen

Parameters

$js string
The code to output

Returns string


public string ready ( string $js )

Ready

Outputs a javascript library mouseup event

Parameters

$js string
The element to attach the event to

Returns string


public string resize ( string $element = 'this', string $js = '' )

Resize

Outputs a javascript library resize event

Parameters

$element string
The element to attach the event to

$js string
The code to execute

Returns string


public string scroll ( string $element = 'this', string $js = '' )

Scroll

Outputs a javascript library scroll event

Parameters

$element string
The element to attach the event to

$js string
The code to execute

Returns string


public string unload ( string $element = 'this', string $js = '' )

Unload

Outputs a javascript library unload event

Parameters

$element string
The element to attach the event to

$js string
The code to execute

Returns string


public string addClass ( string $element = 'this', string $class = '' )

Add Class

Outputs a javascript library addClass event

Parameters

$element string
- element

$class string
- Class to add

Returns string


public string animate ( string $element = 'this', string $params = array(), string $speed = '', mixed $extra = '' )

Animate

Outputs a javascript library animate event

Parameters

$element string
- element

$params string
- One of 'slow', 'normal', 'fast', or time in milliseconds

$speed string
- Javascript callback function

$extra

Returns string


public string fadeIn ( string $element = 'this', string $speed = '', string $callback = '' )

Fade In

Outputs a javascript library hide event

Parameters

$element string
- element

$speed string
- One of 'slow', 'normal', 'fast', or time in milliseconds

$callback string
- Javascript callback function

Returns string


public string fadeOut ( string $element = 'this', string $speed = '', string $callback = '' )

Fade Out

Outputs a javascript library hide event

Parameters

$element string
- element

$speed string
- One of 'slow', 'normal', 'fast', or time in milliseconds

$callback string
- Javascript callback function

Returns string


public string slideUp ( string $element = 'this', string $speed = '', string $callback = '' )

Slide Up

Outputs a javascript library slideUp event

Parameters

$element string
- element

$speed string
- One of 'slow', 'normal', 'fast', or time in milliseconds

$callback string
- Javascript callback function

Returns string


public string removeClass ( string $element = 'this', string $class = '' )

Remove Class

Outputs a javascript library removeClass event

Parameters

$element string
- element

$class string
- Class to add

Returns string


public string slideDown ( string $element = 'this', string $speed = '', string $callback = '' )

Slide Down

Outputs a javascript library slideDown event

Parameters

$element string
- element

$speed string
- One of 'slow', 'normal', 'fast', or time in milliseconds

$callback string
- Javascript callback function

Returns string


public string slideToggle ( string $element = 'this', string $speed = '', string $callback = '' )

Slide Toggle

Outputs a javascript library slideToggle event

Parameters

$element string
- element

$speed string
- One of 'slow', 'normal', 'fast', or time in milliseconds

$callback string
- Javascript callback function

Returns string


public string hide ( string $element = 'this', string $speed = '', string $callback = '' )

Hide

Outputs a javascript library hide action

Parameters

$element string
- element

$speed string
- One of 'slow', 'normal', 'fast', or time in milliseconds

$callback string
- Javascript callback function

Returns string


public string toggle ( string $element = 'this' )

Toggle

Outputs a javascript library toggle event

Parameters

$element string
- element

Returns string


public string toggleClass ( string $element = 'this', mixed $class = '' )

Toggle Class

Outputs a javascript library toggle class event

Parameters

$element string
- element

$class

Returns string


public string show ( string $element = 'this', string $speed = '', string $callback = '' )

Show

Outputs a javascript library show event

Parameters

$element string
- element

$speed string
- One of 'slow', 'normal', 'fast', or time in milliseconds

$callback string
- Javascript callback function

Returns string


public string compile ( string $view_var = 'script_foot', mixed $script_tags = TRUE )

Compile

gather together all script needing to be output

Parameters

$view_var string
The element to attach the event to

$script_tags

Returns string


public clear_compile ( )

Clear Compile

Clears any previous javascript collected for output


public string external ( string $external_file = '', mixed $relative = FALSE )

External

Outputs a <script> tag with the source as an external js file

Parameters

$external_file string
The element to attach the event to

$relative

Returns string


public string inline ( string $script, boolean $cdata = TRUE )

Inline

Outputs a <script> tag

Parameters

$script string
The element to attach the event to

$cdata boolean
If a CDATA section should be added

Returns string


public string _open_script ( string $src = '' )

Open Script

Outputs an opening <script>

Parameters

$src string

Returns string


public string _close_script ( string $extra = "\n" )

Close Script

Outputs an closing </script>

Parameters

$extra string

Returns string


public string update ( string $element = 'this', string $speed = '', string $callback = '' )

Update

Outputs a javascript library slideDown event

Parameters

$element string
- element

$speed string
- One of 'slow', 'normal', 'fast', or time in milliseconds

$callback string
- Javascript callback function

Returns string


public string generate_json ( mixed $result = NULL, boolean $match_array_type = FALSE )

Generate JSON

Can be passed a database result or associative array and returns a JSON formatted string

Parameters

$result mixed
result set or array

$match_array_type boolean
match array types (defaults to objects)

Returns string
a json formatted string


public type _is_associative_array ( type $arr )

Is associative array

Checks for an associative array

Parameters

$arr type

Returns type


public type _prep_args ( type $result, mixed $is_key = FALSE )

Prep Args

Ensures a standard json value and escapes values

Parameters

$result type

$is_key

Returns type

<table class="summary" id="properties">
<caption>Properties summary</caption>
<tr data-order="_javascript_location" id="$_javascript_location">
	<td class="attributes"><code>
		public  
		string
	</code></td>

	<td class="name">

$_javascript_location

'js'
#
		<div class="description detailed">
			

		</div>
	</div></td>
</tr>
</table>
⚠️ **GitHub.com Fallback** ⚠️