User Guide
240 Chapter 14: Behaviors
Example
// the following instance of displayHelp() opens
// in a browser a file that explains how to use
// the extension.
function displayHelp(){
var myHelpFile = dw.getConfigurationPath() +
'/ExtensionsHelp/superDuperHelp.htm';
dw.browseDocument(myHelpFile);
}
deleteBehavior()
Description
This function undoes any edits that the applyBehavior() function performed.
Note: Dreamweaver automatically deletes the function declaration and the event handler that are
associated with a behavior when the user deletes the behavior in the Behaviors panel. It is necessary
to define the
deleteBehavior() function only if the applyBehavior() function performs additional
edits on the user’s document (for example, if it inserts a tag).
Arguments
applyBehaviorString
• This argument is the string that the applyBehavior() function returns.
Returns
Dreamweaver expects nothing.
identifyBehaviorArguments()
Description
This function identifies arguments from a behavior function call as navigation links, dependent
files, URLs, Netscape Navigator 4.0-style references, or object names so that URLs in behaviors
can update if the user saves the document to another location and so the referenced files can
appear in the site map and be considered dependent files for the purposes of uploading to and
downloading from a server.
Arguments
theFunctionCall
• This argument is the string that the applyBehavior() function returns.
Returns
Dreamweaver expects a string that contains a comma-separated list of the types of arguments in
the function call. The length of the list must equal the number of arguments in the function call.
Argument types must be one of the following types:
• The nav argument type specifies that the argument is a navigational URL, and therefore, it
should appear in the site map.
• The dep argument type specifies that the argument is a dependent file URL, and therefore, it
should be included with all other dependent files when a document that contains this behavior
is downloaded from or uploaded to a server.