416
Chapter 18: Code
Arguments
offset, {searchDirection}
•
The
offset
argument is a number that specifies the offset in the code for which the function
will return any errors.
•
The
searchDirection
argument, which is optional, is a string that specifies "
empty
",
"
forward"
or "
back".
If specified, the function searches forward or back from the given
offset to the next characters with errors and returns them. If not specified, the function simply
checks for errors at the given offset.
Returns
An array of objects or the value
null
. Each object in the array has the following properties:
•
The
message
object is a string that contains the error message.
•
The
floaterName
object is a string that contains the name of the results window. You can pass
this value to the
showResults()
or
setFloaterVisibility()
functions.
•
The
floaterIndex
object is an index of items in the floater results list.
•
The
start
object is the opening index of underlined code.
•
The
end
object is the
closing index of underlined code.
Note:
The returned floater indexes should not be stored because they can change frequently, such as
when documents are opened or closed.
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.
000_DW_API_Print.book Page 416 Wednesday, August 20, 2003 9:14 AM
Summary of Contents for DREAMWEAVER MX 2004-DREAMWEAVER API
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...