• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 3. Creating Custom Behaviors > How Behaviors Are Constructed

How Behaviors Are Constructed

Like objects, behaviors are constructed from HTML and JavaScript, and are either located in one HTML file or created as an HTML file and linked JavaScript (JS) file. The Application Programming Interface (API) requirements for behaviors are stricter than those for objects. In particular, behaviors must insert a generic (non-customizable) function in the head of a user’s document and a customizable function call with an event handler elsewhere in the document (see Figure 3.1). All behaviors must present dialog boxes, even if there are no user input options to collect. Behavior files also include several required API functions, as opposed to the single required function for objects.

Figure 3.1. A Dreamweaver document with behavior code inserted.



PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint