User Guide
534 Code
Example
The following example calls getValidationErrorsForOffset() to check for any errors at
the offset of the current selection. If the function returns an error, the code calls the
alert()
function to display the error message to the user.
var offset = dw.getDocumentDOM().source.getSelection()[0];
var errors =
dw.getDocumentDOM().source.getValidationErrorsForOffset(offset);
if ( errors && errors.length > 0 )
alert( errors[0].message );
dom.source.indentTextview()
Availability
Dreamweaver 4.
Description
Moves selected Code view text one tab stop to the right.
Arguments
None.
Returns
Nothing.
dom.source.insert()
Availability
Dreamweaver 4.
Description
Inserts the specified string into the source code at the specified offset from the beginning of
the source file. If the offset is not greater than or equal to zero, the insertion fails and the
function returns
false.
Arguments
offset, string
■ The offset argument is the offset from the beginning of the file where the string must
be inserted.
■ The string argument is the string to insert.
000_DW_API_Print.book Page 534 Wednesday, July 20, 2005 11:58 AM