Chapter 36. Creating a Behavior

IN THIS CHAPTER

  • Building a behavior: The basics

  • Working with the Document Object Model

  • Exploring the Dreamweaver API

  • Streamlining your code with common functions

  • Accessing useful behavior techniques

The technology of Dreamweaver client-side behaviors is open. Anybody with the requisite JavaScript and HTML skills can write a behavior. To talk about writing a behavior, however, is a bit of a mistake. You never actually touch the event portion of the behavior—you work only on the action file. To help the creation process, Dreamweaver provides a comprehensive Extending Dreamweaver document, which covers all the custom functions, JavaScript extensions, and the Document Object Model (DOM) that Dreamweaver recognizes.

The functionality and implementation of behaviors in Dreamweaver have greatly expanded since the original release. By incorporating a much broader DOM, Dreamweaver can now read and affect virtually any element on the current HTML page. You can even use behaviors to open other existing documents or create new Web pages from scratch. Perhaps more importantly, the JavaScript API (that is, the set of JavaScript functions built into Dreamweaver) is extremely comprehensive, offering over 600 functions affecting virtually every area of extensibility.

This chapter covers the primary features pertaining directly to behaviors, but the majority of the JavaScript API is beyond the scope of this book. Before you delve into the nuts and bolts of behavior building, ...

Get Dreamweaver® CS3 Bible now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.