The goog.ds.JsXmlHttpDataSource Class

goog.ds.JsXmlHttpDataSource
> goog.ds.FastDataNode
> goog.ds.AbstractFastDataNode
> goog.ds.DataNodeList
> goog.ds.DataNode

goog.ds.JsXmlHttpDataSource(uri, name, opt_startText, opt_endText, opt_usePost)

Similar to JsonDataSource, with using XMLHttpRequest for transport Currently requires the result be a JS object that can be evaluated and set to a variable and doesn't require strict JSON notation.

uri {string || goog.Uri}
URI for the request.
name {string}
Name of the datasource.
opt_startText {string=}
Text to expect/strip before JS response.
opt_endText {string=}
Text to expect/strip after JS response.
opt_usePost {boolean=}
If true, use POST. Defaults to false (GET).

.add(value)

Inherited from goog.ds.FastDataNode .

Adds a child to this data node.

value {goog.ds.DataNode}
Child node to add.

.clone()

Inherited from goog.ds.FastDataNode .

Creates a deep copy of this data node.

returns {goog.ds.FastDataNode}
Clone of this data node.

.get(opt_key)

Inherited from goog.ds.FastDataNode .

Gets the value of this data node (if called without opt_key) or gets a child node (if called with opt_key).

opt_key {string=}
Name of child node.
returns {*}
This data node or a child node.

.getByIndex(index)

Inherited from goog.ds.FastDataNode .

Gets a child node by index. This method has a complexity of O(n) where n is the number of children. If you need a faster implementation of this method, you should use goog.ds.FastListNode.

index {number}
Index of child node (starting from 0).
returns {goog.ds.DataNode}
Child node at specified index.

.getChildNode(name, opt_create)

Inherited from goog.ds.FastDataNode .

Get a child node by name.

name {string}
Name of child node.
opt_create {boolean=}
Whether to create the child if it does not exist.
returns {goog.ds.DataNode}
Child node.

.getChildNodeValue(name)

Inherited from goog.ds.FastDataNode .

Returns the value of a child node. By using this method you can avoid the need to create PrimitiveFastData nodes.

name {string}
Name of child node.
returns {Object}
Value of child node.

.getChildNodes()

Inherited from goog.ds.FastDataNode .

.getCount()

Inherited from goog.ds.FastDataNode .

Gets the number of child nodes. This method has a complexity of O(n) where n is the number of children. If you need a faster implementation of this method, you should use goog.ds.FastListNode.

returns {number}
Number of child nodes.

.getDataName()

Inherited from goog.ds.AbstractFastDataNode .

Return the name of this data node.

returns {string}
Name of this data noden.

.getDataPath()

Inherited from goog.ds.AbstractFastDataNode .

Get the path leading to this data node.

returns {string}
Data path.

.getJsObject()

Inherited from goog.ds.FastDataNode .

Returns a javascript object representation of this data node. You should not modify the object returned by this function.

returns {Object}
Javascript object representation of this data node.

.getLoadState()

Gets the state of the backing data for this node

returns {goog.ds.LoadState}
The state.

.isList()

Inherited from goog.ds.FastDataNode .

Returns whether this data node is a list. Always returns false for instances of FastDataNode but may return true for subclasses.

returns {boolean}
Whether this data node is array-like.

.load()

Load or reload the backing data for this node. Fires the JsonDataSource

.removeNode()

Inherited from goog.ds.FastDataNode .

Removes a child node.

.set(value)

Inherited from goog.ds.FastDataNode .

Not supported for normal FastDataNodes.

value {*}
Value to set data node to.

.setChildNode()

Inherited from goog.ds.FastDataNode .

Sets a child node. Creates the child if it does not exist. Calling this function makes any child nodes previously obtained for name invalid. You should not use these child nodes but instead obtain a new instance by calling getChildNode.

.setDataName(value)

Inherited from goog.ds.AbstractFastDataNode .

Set the name of this data node.

value {string}
Name.

.setNode(name, value)

Inherited from goog.ds.FastDataNode .

Sets a child node.

name {string}
Name of child node.
value {Object}
Value of child node.

.setQueryData(data)

Sets the request data. This can be used if it is required to send a specific body rather than build the body from the query parameters. Only used in POST requests.

data {string}
The data to send in the request body.