Adobe 38040334 API Reference - Page 262
dom.offsetsToNode, of characters that is an object in the DOM tree.
![]() |
UPC - 883919090467
View all Adobe 38040334 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 262 highlights
DREAMWEAVER CS3 257 API Reference Description Gets the position of a specific node in the DOM tree, which is expressed as character offsets into the document's source code. It is valid for any document on a local drive. Arguments node • The node argument must be a tag, comment, or range of text that is a node in the tree that the dreamweaver.getDocumentDOM() function returns. Returns An array that contains two integers. The first integer is the character offset of the beginning of the tag, text, or comment. The second integer is the character offset of the end of the node, from the beginning of the HTML document. Example The following code selects the first image object in the current document: var theDOM = dw.getDocumentDOM(); var theImg = theDOM.images[0]; var offsets = theDom.nodeToOffsets(theImg); theDom.setSelection(offsets[0], offsets[1]); dom.offsetsToNode() Availability Dreamweaver 3. Description Gets the object in the DOM tree that completely contains the range of characters between the specified opening and closing points. It is valid for any document on a local drive. Arguments offsetBegin, offsetEnd • The offsetBegin argument specifies the offset from the beginning of the document to the beginning of a range of characters that is an object in the DOM tree. • The offsetEnd argument specifies the offset from the beginning of the document to the end of a range of characters that is an object in the DOM tree. Returns The tag, text, or comment object that completely contains the specified range of characters. Example The following code displays an alert if the selection is an image:
![](/manual_guide/products/adobe-38040334-api-reference-b593776/262.png)