Namespace $_.util
Defined in: util.js.
Method Summary
css(string, string)
Sets or retrieves a css property of the element specified by the current selector.
array_combine(array/object, array/object)
Creates an object, with the property names of the first array, and the values of the second.
str_trans(string, mixed, string)
Replaces sections of strings in a greedy fashion, starting with the longest replace pairs first.
Method Detail
$_.util.text(string)
: string
Sets or retrieves the text content of the element
specified by the current selector. If a value is
passed, it will set that value on the current element,
otherwise it will return the value of the current element
Defined in: DOM.js.
Parameters:
string?, Default: | value |
Returns:
string |
$_.util.css(string, string)
: string
Sets or retrieves a css property of the element
specified by the current selector. If a value is
passed, it will set that value on the current element,
otherwise it will return the value of the css property
on the current element
Defined in: DOM.js.
Parameters:
string | property | |
string?, Default: | value |
Returns:
string |
$_.util.object_keys(object)
: array
Retrieve the keys, or member names of an object
Parameters:
object |
Returns:
array |
$_.util.object_values(object)
: array
Retrieves the values of an object, and returns
them as an array
Parameters:
object |
Returns:
array |
$_.util.array_combine(array/object, array/object)
: object
Creates an object, with the property names of the first array,
and the values of the second. If objects are passed, the values
of the object are used. If the arrays or objects passed are
not the same size, the function will return false.
Parameters:
array/object | keys | |
array/object | vals |
Returns:
object |
$_.util.object_merge(object)
: object
Combines two or more objects/arrays. If the keys are numeric, the outputted
object will have re-indexed keys. If a key/value pair exists in both objects,
indentical values will be droped, but if a key exists with a different value,
with the same key, the value in the second array will replace the value in the
first
Parameters:
object | [as many as you wish to combine] |
Returns:
object |
$_.util.str_trans(string, mixed, string)
: string
Replaces sections of strings in a greedy fashion,
starting with the longest replace pairs first. Accepts
one replace pair as two parameters, or an object, with
from => to replacements as key/value pairs
Parameters:
string | input_string | |
mixed | ||
string?, Default: | to |
Returns:
string |