Returns
An array that contains two integers. The first integer is the byte offset for the beginning of the
selection; the second integer is the byte offset for the end of the selection. If the two numbers
are the same, the current selection is an insertion point.
dreamweaver.nodeExists()
Available
Dreamweaver 3.
Description
Determines whether the reference to the specified node is still good. Often when writing
extensions, you reference a node and then perform an operation that deletes it (such as setting
the
or
innerHTML
outerHTML
node hasn't been deleted before you attempt to reference any of its properties or methods. The
referenced node does not need to be in the current document.
Arguments
node
The
argument is the node that you want to check.
node
Returns
A Boolean value:
true
Example
The following example gets the current node, locates a table within it, and later calls
to see if the original node still exists:
dw.nodeExists()
function applyFormatToSelectedTable(){
// get current selection
var selObj = dw.getDocumentDOM().getSelectedNode();
alternateRows(dwscripts.findDOMObject("presetNames").selectedIndex,
findTable());
// restore original selection, if it still exists; if not, just select the
// table.
var selArr;
if (dw.nodeExists(selObj))
selArr = dom.nodeToOffsets(selObj);
properties of its parent). This function lets you confirm that the
if the node exists;
false
otherwise.
Selection functions
341
Need help?
Do you have a question about the DREAMWEAVER 8-DREAMWEAVER API and is the answer not in the manual?