Inside JavaScript

The addBehavior Method

You use the addBehavior method to add a new Internet Explorer behavior to an object, passing this method the URL of the behavior. You can see the support for this method in Table 6.5.

Table 6.5. The addBehavior Method

Method

NS2

NS3

NS4

NS6

IE3a

IE3b

IE4

IE5

IE5.5

IE6

addBehavior ( URL )

             

x

x

x

 

Returns: Integer

As discussed in Chapter 4, a behavior is a customized script you can save as an external file that can be applied to any HTML element and that has access to some powerful techniques. This method returns a behavior ID value that you can later pass to removeBehavior (covered later in this chapter) to remove the behavior. We'll see how to work with behaviors in Chapter 17, "Dynamic HTML: Drag and Drop, Data Binding, and Behaviors."

Категории