Dom.getselectorsdefinedinstylesheet(), Dom.nodetooffsets() – Adobe Dreamweaver API Reference CS5 User Manual
Page 296

291
DREAMWEAVER API REFERENCE
Document
Last updated 8/27/2013
For complex selections (multiple table cells, multiple layers, or multiple image map hotspots), an array that contains
2n integers, where n is the number of selected items. The first integer in each pair is the character offset of the opening
of the selection (including the opening
TD
,
DIV
,
SPAN
,
LAYER
,
ILAYER
, or
MAP
tag); the second integer in each pair is
the character offset of the closing of the selection (including the closing
TD
,
DIV
,
SPAN
,
LAYER
,
ILAYER
, or
MAP
tag). If
multiple table rows are selected, the offsets of each cell in each row return. The selection never includes the
TR
tags.
dom.getSelectorsDefinedInStylesheet()
Availability
Dreamweaver 8.
Description
Gets an array of selectors that match the type passed in as an attribute.
Arguments
selector
•
The
selector
argument is a string of value
class
or
ID
. It specifies whether the function returns selectors of the
type
class
or
ID
.
Returns
An array of selectors that can be either of the type
class
or
ID
.
Example
The following code is used to get an array of selectors of the type
class
:
var dom=dw.getDocumentDOM();
var classSelectors = dom.getSelectorsDefinedInStylesheet('class');
The following code is used to get an array of selectors of the type
ID
:
var dom=dw.getDocumentDOM();
var classSelectors = dom.getSelectorsDefinedInStylesheet('ID');
dom.nodeToOffsets()
Availability
Dreamweaver 3.
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.