Description |
Determines whether the action is allowed for the selected HTML element and specifies the default event that should trigger the action. May also check for the existence of certain objects (such as Shockwave movies) in the user's document and disallow the action if these objects do not appear. |
Arguments |
HTMLelement |
|
The argument is the selected HTML element. |
Returns |
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 steps 2 and 3 in How behaviors work. |
 |
FALSE if the action is not allowed. |
|
|
If canAcceptBehavior() returns FALSE , the action is dimmed in the Actions pop-up menu in the Behavior inspector. |
Example |
The following instance of canAcceptBehavior() returns a list of preferred events for the behavior if the document has any named images: |
 |
|