Dreamweaver.nodeexists() – Adobe Dreamweaver API Reference CS5 User Manual
Page 299

294
DREAMWEAVER API REFERENCE
Document
Last updated 8/27/2013
Arguments
offsetBegin, offsetEnd
•
These arguments are the opening and closing points, respectively, for the new selection, which is expressed as
character offsets into the document’s source code. If the two numbers are the same, the new selection is an insertion
point. If the new selection is not a valid HTML selection, it is expanded to include the characters in the first valid
HTML selection. For example, if offsetBegin and offsetEnd define the range
SRC="myImage.gif"
within
SRC="myImage.gif">
, the selection expands to include the entire
IMG
tag.
Returns
Nothing.
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
innerHTML
or
outerHTML
properties of its
parent). This function lets you confirm that the 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 node argument is the node that you want to check.
Returns
A Boolean value:
true
if the node exists;
false
otherwise.
Example
The following example gets the current node, locates a table within it, and later calls
dw.nodeExists()
to see if the
original node still exists: