Specifications

Chapter 13138
Note: Quotation marks within the returned string must be preceded by a backslash (\) to avoid errors that the
JavaScript interpreter reports.
Example
The following instance of behaviorFunction() returns a function called MM_popupMsg():
function behaviorFunction(){
return ""+
"function MM_popupMsg(theMsg) { //v1.0\n"+
" alert(theMsg);\n"+
"}";
}
The following example is equivalent to the preceding behaviorFunction() declaration and is
the method used to declare
behaviorFunction() in all behaviors that come with Dreamweaver:
function MM_popupMsg(theMsg){ //v1.0
alert(theMsg);
}
function behaviorFunction(){
return "MM_popupMsg";
}
canAcceptBehavior()
Description
Determines whether the action is allowed for the selected HTML element and specifies the
default event that should trigger the action. Can also check for the existence of certain objects
(such as Shockwave movies) in the users document and not allow the action if these objects
do not appear.
Arguments
HTMLElement
The argument is the selected HTML element.
Returns
Dreamweaver expects one of the following values:
true if the action is allowed but has no preferred events.
A list of preferred events (in descending order of preference) for this action. Specifying
preferred events overrides the default event (as denoted with an asterisk [*] in the Event file)
for the selected object. See step 1 in How Behaviors work on page 135.
false if the action is not allowed.
If
canAcceptBehavior() returns false, the action is dimmed in the Actions pop-up menu in
the Behaviors panel.