ish.type.dom

Document Object Model-based type functionality.

Source:

Methods

[mixin] ish.type.dom.append(vDomParent, vDomToAdd) → {boolean}

Source:
Appends the passed value into the referenced parent as the last element.
From Mixin: ish.type-ex.js must be included for ishJS to access this functionality.
Client-Side Only: This functionality is only available under a browser (Firefox, Chrome, etc.).
Note: The passed DOM elements are passed through {@link: ish.type.dom.mk}.
Parameters:
Name Type Description
vDomParent variant Value representing the parent DOM element.
vDomToAdd variant Value representing the DOM element to insert.
Returns:
Type Description
boolean Value representing if the passed value was successfully inserted.

[mixin] ish.type.dom.cp(x, bDeepCopyopt) → {Array.<variant>}

Source:
Copies the passed value into a new instance using cloneNode.
From Mixin: ish.type-ex.js must be included for ishJS to access this functionality.
Client-Side Only: This functionality is only available under a browser (Firefox, Chrome, etc.).
Note: This is functionally a type-safe wrapper of cloneNode.
Parameters:
Name Type Attributes Default Description
x Array.<variant> Value representing the DOM element to copy.
bDeepCopy boolean <optional>
false Value representing if the children of the DOM element should also be cloned. false performs a copy of the DOM element only while true also performs a copy of the child DOM elements.
Returns:
Type Description
Array.<variant> Value representing the passed value as a new instance.

[client] ish.type.dom.id(sPrefixopt) → {element}

Source:
Generates a unique DOM ID.
Client-Side Only: This functionality is only available under a browser (Firefox, Chrome, etc.).
Parameters:
Name Type Attributes Default Description
sPrefix string <optional>
"" Value representing the DOM ID's prefix.
Returns:
Type Description
element Value representing a unique DOM ID.

[client] ish.type.dom.id.is(sID) → {boolean}

Source:
Determines if the passed value represents a reconized DOM ID.
Client-Side Only: This functionality is only available under a browser (Firefox, Chrome, etc.).
Parameters:
Name Type Description
sID string Value representing the DOM ID to test.
Returns:
Type Description
boolean Value representing if the passed value represents a reconized DOM ID.

[client] ish.type.dom.is(x, vOptionsopt) → {boolean}

Source:
See:
Determines if the passed value is a DOM element.
Client-Side Only: This functionality is only available under a browser (Firefox, Chrome, etc.).
Parameters:
Name Type Attributes Default Description
x variant Value to interrogate.
vOptions object | boolean <optional>
false Value representing if CSS selectors that successfully resolve to DOM elements are to be reconized or the desired options:
Properties
Name Type Attributes Default Description
allowSelector boolean <optional>
false Value representing if CSS selectors that successfully resolve to DOM elements are to be reconized.
allowHTML boolean <optional>
false Value representing if HTML that successfully parses to DOM elements are to be reconized.
Returns:
Type Description
boolean Value representing if the passed value is a DOM element.

[client] ish.type.dom.mk(x, _defaultValopt, bReturnMultipleAsArray) → {element|Array.<element>}

Source:
Casts the passed value into a DOM element.
Client-Side Only: This functionality is only available under a browser (Firefox, Chrome, etc.).
Note: If the value to interrogate represents multiple top-level DOM elements, they will be returned under a single
who has a property of parsedMultiple=true.
Parameters:
Name Type Attributes Default Description
x variant | string Value to interrogate.
_defaultVal element <optional>
<div></div> Value representing the default return value if casting fails.
bReturnMultipleAsArray boolean Value representing if we are to return multiple DOM elements as an array.
Returns:
Type Description
element | Array.<element> Value representing the passed value as a DOM element.

[client] ish.type.dom.parse(sHTML, _defaultValopt) → {element}

Source:
See:
Parses the passed value as a DOM element.
Client-Side Only: This functionality is only available under a browser (Firefox, Chrome, etc.).
Parameters:
Name Type Attributes Description
sHTML string Value to parse.
_defaultVal element <optional>
Value representing the default return value if casting fails.
Returns:
Type Description
element Value representing the passed value as a DOM element.

[mixin] ish.type.dom.prepend(vDomParent, vDomToAdd) → {boolean}

Source:
Prepends the passed value into the referenced parent as the first element.
From Mixin: ish.type-ex.js must be included for ishJS to access this functionality.
Client-Side Only: This functionality is only available under a browser (Firefox, Chrome, etc.).
Note: The passed DOM elements are passed through {@link: ish.type.dom.mk}.
Parameters:
Name Type Description
vDomParent variant Value representing the parent DOM element.
vDomToAdd variant Value representing the DOM element to insert.
Returns:
Type Description
boolean Value representing if the passed value was successfully inserted.

[mixin] ish.type.dom.replace(vTarget, vReplacement) → {boolean}

Source:
Replaces the referenced DOM element with the passed value.
From Mixin: ish.type-ex.js must be included for ishJS to access this functionality.
Client-Side Only: This functionality is only available under a browser (Firefox, Chrome, etc.).
Note: The passed DOM elements are passed through {@link: ish.type.dom.mk}.
Parameters:
Name Type Description
vTarget variant Value representing the target DOM element to replace.
vReplacement variant Value representing the DOM element to insert.
Returns:
Type Description
boolean Value representing if the passed value was successfully inserted.