beautypg.com

Selection functions, Dom.getselectednode(), Dom.getselection() – Adobe Dreamweaver API Reference CS5 User Manual

Page 295

background image

290

DREAMWEAVER API REFERENCE

Document

Last updated 8/27/2013

Arguments
A string specifying the local filename that needs to be encoded as a URI.

Returns
Nothing.

Selection functions

Selection functions get and set the selection in open documents. For information on getting or setting the selection in
the Site panel, see

Site functions

” on page 216.

dom.getSelectedNode()

Availability
Dreamweaver 3.

Description
Gets the selected node. Using this function is equivalent to calling the

dom.getSelection()

function and passing the

return value to the

dom.offsetsToNode()

function.

Arguments
None.

Returns
The tag, text, or comment object that completely contains the specified range of characters.

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.