Node.compareDocumentPosition(options)
Method Description |
Returns a number that reflects where two nodes are located, compared to each other. Returns one of the following numbers:
Note:
The return value can be a combination of the above values. For example, a return value of 20 means the specified node is contained by the current node, a value of 16, and the specified node follows the current node, a value of 4.
Important:
This method is not supported on Internet Explorer. |
Returns |
number |
Supported Script Types |
Client and server scripts For more information, see SuiteScript 2.x Script Types. |
Governance |
None |
Module |
|
Since |
2015.2 |
Parameters
The options parameter is a JavaScript object.
Parameter |
Type |
Required / Optional |
Description |
---|---|---|---|
|
required |
The node to compare with the current node. |
Errors
Error Code |
Message |
Thrown If |
---|---|---|
|
Invalid argument type, expected xml.Node or subclass: other |
The options.other is of type xml.Node. |
Syntax
The following code sample shows the syntax for this member. It is not a functional example. For a complete script example, see N/xml Module Script Samples.
//Add additional code
...
var posCode = elem[0].compareDocumentPosition({
other : parentNode[0]
});
...
//Add additional code