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()
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
If the HTML element contains code that is similar to 'onClick="someBehavior();
return document.MM_returnValue;"', and you add a new behavior from the behavior
menu, Dreamweaver calls inspectBehavior() as soon as the new behavior UI pops up,
and passes an empty string as the parameter. Consequently, be sure to check the
applyBehaviorString parameter, as shown in the following example:
function inspectBehavior(enteredStr){
if(enteredStr){
//do your work here
}
}
Returns
Dreamweaver expects nothing.
Example
The following instance of the
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));
}
}
function is not defined, the default option values appear.
applyBehavior()
inspectBehavior()
function returns.
function, taken from the Display Status
The Behaviors API
319
Need help?
Do you have a question about the DREAMWEAVER 8-EXTENDING DREAMWEAVER and is the answer not in the manual?
Questions and answers