User Guide
242 Chapter 14: Behaviors
inspectBehavior()
Description
This function inspects the function call for a previously applied behavior in the user’s document
and sets the values of the options in the Parameters dialog box accordingly. If the
inspectBehavior() function is not defined, the default option values appear.
Note: The inspectBehavior() function must rely solely on information that the applyBehaviorString
argument passes to it. Do not attempt to obtain other information about the user’s document (for
example, using
dreamweaver.getDocumentDOM()) within this function.
Arguments
applyBehaviorString
• This argument is the string that the applyBehavior() function returns.
Returns
Dreamweaver expects nothing.
Example
The following instance of the inspectBehavior() function, taken from the Display Status
Message.htm file, fills in the Message field in the Parameters dialog box with the message that the
user selected when the behavior was originally applied:
function inspectBehavior(msgStr){
var startStr = msgStr.indexOf("'") + 1;
var endStr = msgStr.lastIndexOf("'");
if (startStr > 0 && endStr > startStr) {
document.theForm.message.value = ¬
unescQuotes(msgStr.substring(startStr,endStr));
}
}
Note: For more information about the
unescQuotes() function, see the dwscripts.js file in the
Configuration/Shared/Common/Scripts/CMN folder.
windowDimensions()
Description
This function sets specific dimensions for the Parameters dialog box. If this function is not
defined, the window dimensions are computed automatically.
Note: Do not define this function unless you want an Parameters dialog box that is larger than
640 x 480 pixels.
Arguments
platform
• The value of the argument is either "macintosh" or "windows", depending on the user’s
platform.
Returns
Dreamweaver expects a string of the form "widthInPixels,heightInPixels".