API Docs for: 1.0.2
Show:

AW2 Class

Defined in: src\aw2.js:1
Module: aw2

aw2 library core

Methods

arrayContains

(
  • arr
  • el
)
Number

Defined in src\aw2.js:219

test if an element exists in an array starting at the specific index

Parameters:

  • arr Array

    the array to check

  • el Any

    the element to look for

Returns:

Number: the index of the found element or -1 if not found

Example:

$aw2.arrayContains([1,2,3,4,5,6], 1)

var x = ['Andy','Alan','Matthew','Simon'];
$aw2.arrayContains(x, 'Matthew');

arrayFirst

(
  • array
)
Any

Defined in src\aw2.js:282

Return the first item in an array

Parameters:

  • array Array

    the array you wish to return the first item from

Returns:

Any: the first item of the array

Example:

$aw2.arrayFirst(['Matthew','Jim','Sandy']);

arrayLast

(
  • array
)
Any

Defined in src\aw2.js:297

Return the last item in an array

Parameters:

  • array Array

    the array you wish to return the first item from

Returns:

Any: the last item of the array

Example:

$aw2.arrayLast(['Matthew','Jim','Sandy']);

arrayToList

(
  • array
  • separator=","
)
Undefined

Defined in src\aw2.js:242

convert an array to a string list using a given separation character

Parameters:

  • array Array

    the array to convert to a list

  • separator="," String

    the character to use for separating the list

Returns:

Undefined:

Example:

$aw2.arrayToList(['Matthew','Jim','Sandy']);

extend

(
  • arg
)

Defined in src\aw2.js:147

enable extension of the library from additional sources

Parameters:

  • arg Object multiple

    multiple objects to extend core library functionality

isArray

(
  • array
)
Boolean

Defined in src\aw2.js:201

check if array

Parameters:

  • array Array

    the array to check

Returns:

Boolean: true or false

Example:

$aw2.isArray([1,2,3]);


$aw2.isArray('string');

isChecked

(
  • domObj
)
Boolean

Defined in src\aw2.js:118

check if a given DOM element has a checked or selected status

Parameters:

  • domObj DOMElement

    a DOM element

Returns:

Boolean: returns true if provided element is checked

Example:

<input type="radio" class="checkMe" />

$aw2('.checkMe').isChecked();

listToArray

(
  • list
  • separator=","
)
Undefined

Defined in src\aw2.js:262

convert a string list to an array using a given separation character

Parameters:

  • list String

    a string list to convert

  • separator="," String

    the character to use for separating the list

Returns:

Undefined:

Example:

$aw2.listToArray('Matthew,Jim,Sandy');

structDelete

(
  • obj
  • key
)
Undefined

Defined in src\aw2.js:337

remove a key from a structure

Parameters:

  • obj Object

    the structure object

  • key String

    the key to be removed

Returns:

Undefined:

Example:

var s = { name : "Matthew", jobTitle : "Developer" }

$aw2.structDelete(s, 'jobTitle')

structKeyExists

(
  • obj
  • key
)
Boolean

Defined in src\aw2.js:316

test if an element exists in a structure

Parameters:

  • obj Object

    the structure object to check

  • key String

    the key to find

Returns:

Boolean: true if the object contains the key

Example:

var s = { name : "Matthew" }

$aw2.structKeyExists(s, 'name') // Returns true

$aw2.structKeyExists(s, 'jobTitle') // Returns false

type

(
  • obj
)
String

Defined in src\aw2.js:185

check the type of a given object

Parameters:

  • obj Any

    an object from which to determine the type

Returns:

String: the type of the object passed in

Properties

_aw2

Any

Defined in src\aw2.js:37

clone any previous aw2 variable in case of overwrite

aw2

Object private

Defined in src\aw2.js:45

initialize internal library

document

Object private

Defined in src\aw2.js:19

internal document tracker

fn

Object private

Defined in src\aw2.js:67

initialize the library provisions when called as a function

location

Object private

Defined in src\aw2.js:28

internal location tracker

version

String private

Defined in src\aw2.js:10

current library version

window.$aw2

Object

Defined in src\aw2.js:357

expose library to window