Helma logo
helma.org » Home > Stories > HopObject.contains()

HopObject.contains()

Determines if a HopObject contains a certain subnode.

Syntax
HopObject.contains(HopObject)

Returns the index position of a Subnode contained by a HopObject (as usual for JavaScript, 0 refers to the first position).

The index position is a relative value inside a HopObject (not to be confused with a Hop ID which is unique for each HopObject).

If there is no appropriate subnode inside the HopObject the returned value equals -1.

Example
var obj = root.get("myObject");
res.write(root.contains(obj));
23

obj = root.get("blobject");
res.write(root.contains(obj));
-1


... comment


Page last modified on 2002-07-16 13:20 by tobi