Jaxer.Util.DOM : Object
Return to: Jaxer Framework index

Namespace used to hold functions and other objects that extend JavaScript's DOM capabilities.

Platform Support

Jaxer Server Framework Jaxer Client Framework
1.0 no

Functions

Method Action Jaxer Server Framework Jaxer Client Framework
static createScript(Document doc, String contents, [Object attributes]) : ScriptElement
Create a new script element with the specified content and attributes
Show Details 1.0 no

Parameters
Document doc The DocumentElement to use when creating elements for the active document.
String contents The text content for the script element. This value will be set via innerHTML once the new script element has been created
Object attributes (optional)A list of attributes and attribute values to apply to the new ScriptElement. Each property name will become the attribute name and each property value will become that attributes value. Note that no escaping is done on the attributes values, so it is expected those values are valid attribute values

Returns
ScriptElement The new script element with content and attributes applied.

static hashToAttributesString(Object hash) : String
Convert an object's properties and property values into a string of attributes suitable for use in creating a string representation of an HTMLElement. Each property is used as the attribute name and each property value becomes the attribute value. Attribute values are surrounding in double-quotes and all property values containing double-quotes will have those characters escaped with backslashes.
Show Details 1.0 no

Parameters
Object hash The source object

Returns
String The resulting string of attribute name/value pairs

static insertScriptAfter(Document doc, Object contents, Node elt, [Object attributes]) : ScriptElement
Creates a new script element and adds it as the next sibling of the specified element in the DOM.
Show Details 1.0 no

Parameters
Document doc The DocumentElement to use when creating elements for the active document.
Object contents The text content for the script element. This value will be set via innerHTML once the new script element has been created
Node elt The element in the DOM after which the new script element will be inserted
Object attributes (optional)A list of attributes and attribute values to apply to the new ScriptElement. Each property name will become the attribute name and each property value will become that attributes value. Note that no escaping is done on the attributes values, so it is expected those values are valid attribute values

Returns
ScriptElement The new script element with content and attributes applied.

static insertScriptAtBeginning(Document doc, Object contents, Node elt, [Object attributes]) : ScriptElement
Creates a new script element and adds it as the first child of a specified element in the DOM.
Show Details 1.0 no

Parameters
Document doc The DocumentElement to use when creating elements for the active document.
Object contents The text content for the script element. This value will be set via innerHTML once the new script element has been created
Node elt The element in the DOM where the new script element will be added as the element's first child.
Object attributes (optional)A list of attributes and attribute values to apply to the new ScriptElement. Each property name will become the attribute name and each property value will become that attributes value. Note that no escaping is done on the attributes values, so it is expected those values are valid attribute values

Returns
ScriptElement The new script element with content and attributes applied.

static insertScriptAtEnd(Document doc, Object contents, Node elt, [Object attributes]) : ScriptElement
Creates a new script element and adds it as the last child of a specified element in the DOM.
Show Details 1.0 no

Parameters
Document doc The DocumentElement to use when creating elements for the active document.
Object contents The text content for the script element. This value will be set via innerHTML once the new script element has been created
Node elt The element in the DOM where the new script element will be added as the element's last child.
Object attributes (optional)A list of attributes and attribute values to apply to the new ScriptElement. Each property name will become the attribute name and each property value will become that attributes value. Note that no escaping is done on the attributes values, so it is expected those values are valid attribute values

Returns
ScriptElement The new script element with content and attributes applied.

static insertScriptBefore(Document doc, Object contents, Node elt, [Object attributes]) : ScriptElement
Creates a new script element and adds it before a specified element in the DOM.
Show Details 1.0 no

Parameters
Document doc The DocumentElement to use when creating elements for the active document.
Object contents The text content for the script element. This value will be set via innerHTML once the new script element has been created
Node elt The element in the DOM before which the new script element will be inserted
Object attributes (optional)A list of attributes and attribute values to apply to the new ScriptElement. Each property name will become the attribute name and each property value will become that attributes value. Note that no escaping is done on the attributes values, so it is expected those values are valid attribute values

Returns
ScriptElement The new script element with content and attributes applied.

static replaceWithScript(Document doc, Object contents, Node elt, [Object attributes]) : ScriptElement
Replace a specified element in the DOM with a new script element.
Show Details 1.0 no

Parameters
Document doc The DocumentElement to use when creating elements for the active document.
Object contents The text content for the script element. This value will be set via innerHTML once the new script element has been created
Node elt The element to replace with the a script element
Object attributes (optional)A list of attributes and attribute values to apply to the new ScriptElement. Each property name will become the attribute name and each property value will become that attributes value. Note that no escaping is done on the attributes values, so it is expected those values are valid attribute values

Returns
ScriptElement The new script element with content and attributes applied.

aptana_docs