Adding New Commands
By their very nature, objects and behaviors are single-purpose engines. A custom object inserts a single
block of HTML into the of a Web page, whereas custom behaviors add JavaScript functions to the
and attributes of one tag. Commands, on the other hand, are multifaceted, multipurpose, goanywhere,
and do-anything mechanisms. Commands can do everything objects and behaviors can do??”
and more. In fact, commands can even masquerade as objects.
For all their power, commands are one of the most accessible of the Dreamweaver extensions. This section
describes the basic structure of commands, as well as how to use the standard commands that ship with
Dreamweaver. You can also find information about how to create your own commands and control their
integration into Dreamweaver.
Understanding Dreamweaver commands
When I first encountered commands, I thought, ???Great! Dreamweaver now has a macro language.??? I envisioned
instantly automating simple Web design tasks. Before long, I realized that commands are even more
powerful??”and a bit trickier??”than a macro recorder. Dreamweaver??™s adoption of the W3C Document
Object Model (DOM) is one of the factors that make commands feasible. The DOM in Dreamweaver
exposes, or makes available, every part of the HTML page??”every tag, every attribute, every bit of content??”
which can then be read, modified, deleted, or added to.
Pages:
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712