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:
-
arrArraythe array to check
-
elAnythe 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:
-
arrayArraythe 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:
-
arrayArraythe 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:
-
arrayArraythe 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:
-
argObject multiplemultiple objects to extend core library functionality
isArray
-
array
check if array
Parameters:
-
arrayArraythe 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:
-
domObjDOMElementa 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:
-
listStringa 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:
-
objObjectthe structure object
-
keyStringthe 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:
-
objObjectthe structure object to check
-
keyStringthe 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:
-
objAnyan 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
