User Guide

Code view toolbar functions 251
dom.source.applyComment()
Availability
Dreamweaver 8.
Description
This function inserts the text specified in the beforeText argument before the current
selection and the text specified in the
afterText argument after the current selection. The
function then extends the current selection to include the added text. However, if there is no
current selection, the function does not select anything. If the text specified in the
afterText
argument is null, the function inserts the text specified in the
beforeText argument at the
beginning of every line in the current selection.
Arguments
beforeText
The beforeText argument is required. It specifies the text to insert at the beginning of
the selection, or, if the value of the
afterText argument is null, it specifies the text to
insert at the beginning of every line in the selection.
afterText
The afterText argument, which is optional, specifies the text to insert at the end of the
selection.
Returns
Nothing.
Example
The following example makes the current selection an HTML comment:
dw.getDocumentDOM().source.applyComment('<!--', '-->')
dom.source.removeComment()
Availability
Dreamweaver 8.
000_DW_API_Print.book Page 251 Wednesday, July 20, 2005 11:58 AM