280
Chapter 14: Document
dom.getSelection()
Availability
Dreamweaver 3.
Description
Gets the selection, which is expressed as character offsets into the document’s source code.
Arguments
{bAllowMultiple}
•
The
bAllowMultiple
argument, which is optional, is a Boolean value that indicates whether
the function should return multiple offsets if more than one table cell, image map hotspot, or
layer is selected.
If this argument is omitted, it defaults to
false
.
Returns
For simple selections, an array that contains two integers. The first integer is the character offset
of the opening of the selection. The second integer is the character offset at the closing of the
selection. If the two numbers are the same, the current selection is an insertion point.
For complex selections (multiple table cells, multiple layers, or multiple image map hotspots), an
array that contains 2
n
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.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.
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.
000_DW_API_Print.book Page 280 Wednesday, August 20, 2003 9:14 AM
Summary of Contents for DREAMWEAVER MX 2004
Page 1: ...Dreamweaver API Reference...
Page 24: ...24 Contents...
Page 32: ......
Page 70: ...70 Chapter 5 Fireworks Integration...
Page 76: ...76 Chapter 6 Flash Integration...
Page 116: ...116 Chapter 9 The JavaBeans API...
Page 140: ......
Page 152: ...152 Chapter 11 Application...
Page 218: ...218 Chapter 12 Workspace...
Page 248: ...248 Chapter 13 Site...
Page 292: ...292 Chapter 14 Document...
Page 378: ...378 Chapter 17 Design...
Page 430: ...430 Chapter 18 Code...
Page 486: ...486 Index...