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 |
Arguments
applyBehaviorString
- This argument is the string that the
applyBehavior()function returns.NOTE
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, Adobe Dreamweaver callsinspectBehavior()as soon as the new behavior UI pops up, and passes an empty string as the parameter. Consequently, be sure to check theapplyBehaviorStringparameter, as shown in the following example:
function inspectBehavior(enteredStr){ if(enteredStr){ //do your work here }}Returns
Adobe 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 |