AW2 Class
aw2 library core
Item Index
Methods
Methods
arrayContains
-
arr
-
el
test if an element exists in an array starting at the specific index
Parameters:
-
arr
Arraythe array to check
-
el
Anythe element to look for
Returns:
Example:
$aw2.arrayContains([1,2,3,4,5,6], 1)
var x = ['Andy','Alan','Matthew','Simon'];
$aw2.arrayContains(x, 'Matthew');
arrayFirst
-
array
Return the first item in an array
Parameters:
-
array
Arraythe array you wish to return the first item from
Returns:
Example:
$aw2.arrayFirst(['Matthew','Jim','Sandy']);
arrayLast
-
array
Return the last item in an array
Parameters:
-
array
Arraythe array you wish to return the first item from
Returns:
Example:
$aw2.arrayLast(['Matthew','Jim','Sandy']);
arrayToList
-
array
-
separator=","
convert an array to a string list using a given separation character
Parameters:
-
array
Arraythe array to convert to a list
-
separator=","
Stringthe character to use for separating the list
Returns:
Example:
$aw2.arrayToList(['Matthew','Jim','Sandy']);
extend
-
arg
enable extension of the library from additional sources
Parameters:
-
arg
Object multiplemultiple objects to extend core library functionality
isArray
-
array
check if array
Parameters:
-
array
Arraythe array to check
Returns:
Example:
$aw2.isArray([1,2,3]);
$aw2.isArray('string');
isChecked
-
domObj
check if a given DOM element has a checked or selected status
Parameters:
-
domObj
DOMElementa DOM element
Returns:
Example:
<input type="radio" class="checkMe" />
$aw2('.checkMe').isChecked();
listToArray
-
list
-
separator=","
convert a string list to an array using a given separation character
Parameters:
-
list
Stringa string list to convert
-
separator=","
Stringthe character to use for separating the list
Returns:
Example:
$aw2.listToArray('Matthew,Jim,Sandy');
structDelete
-
obj
-
key
remove a key from a structure
Parameters:
-
obj
Objectthe structure object
-
key
Stringthe key to be removed
Returns:
Example:
var s = { name : "Matthew", jobTitle : "Developer" }
$aw2.structDelete(s, 'jobTitle')
structKeyExists
-
obj
-
key
test if an element exists in a structure
Parameters:
-
obj
Objectthe structure object to check
-
key
Stringthe key to find
Returns:
Example:
var s = { name : "Matthew" }
$aw2.structKeyExists(s, 'name') // Returns true
$aw2.structKeyExists(s, 'jobTitle') // Returns false
type
-
obj
check the type of a given object
Parameters:
-
obj
Anyan object from which to determine the type
Returns:
Properties
_aw2
Any
clone any previous aw2 variable in case of overwrite
aw2
Object
private
initialize internal library
document
Object
private
internal document tracker
fn
Object
private
initialize the library provisions when called as a function
location
Object
private
internal location tracker
version
String
private
current library version
window.$aw2
Object
expose library to window