Adobe 38040334 - Dreamweaver CS3 User Manual page 265

Api reference
Hide thumbs Also See for 38040334 - Dreamweaver CS3:
Table of Contents

Advertisement

• The
argument is the node that you want to check.
node
Returns
A Boolean value:
if the node exists;
true
Example
The following example gets the current node, locates a table within it, and later calls
original node still exists:
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);
else
selArr = dom.nodeToOffsets(findTable());
dom.setSelection(selArr[0],selArr[1]);
}
dreamweaver.nodeToOffsets() (deprecated)
Availability
Dreamweaver 2; deprecated in 3 in favor of
Description
Gets the position of a specific node in the DOM tree, which is expressed as byte offsets into the document's source
code.
Arguments
node
• The
argument must be a tag, comment, or range of text that is a node in the tree that the
node
weaver.getDocumentDOM()
Returns
An array that contains two integers. The first integer is the byte offset for the opening of the tag, text, or comment;
the second integer is the byte offset for the closing of the node.
dreamweaver.offsetsToNode() (deprecated)
Availability
Dreamweaver 2; deprecated in 3 in favor of
otherwise.
false
"dom.nodeToOffsets()" on page 256
function returns.
"dom.offsetsToNode()" on page 257
DREAMWEAVER CS3
API Reference
to see if the
dw.nodeExists()
.
dream-
.
260

Advertisement

Table of Contents
loading

This manual is also suitable for:

Dreamweaver cs3

Table of Contents