Specifications
Extending Dreamweaver MX 21
Data Translator
extensions convert non-HTML code into HTML that appears in the Design
view of the Document window. These extensions also lock the non-HTML code to prevent it
from being parsed by Dreamweaver. Translator files are stored in the Configuration/Translators
folder.
Data Source extensions let you build a connection to a custom data source. Data source
extensions appear in the plus (
+) menu of the Bindings panel. Data source files are stored in the
Configuration/Data Sources folder.
Server Model extensions let you add support for new server models. Dreamweaver supports the
most common server models (ASP, JSP, ColdFusion, PHP, and ASP.NET). Server model
extensions are needed only for custom server solutions, different languages, or a customized
server. Server model files are stored in the Configuration/ServerModels
folder.
Document Type extensions define how Dreamweaver works with different document types.
Information about document types for server models is stored in the Configuration/
DocumentTypes folder.
How Dreamweaver processes JavaScript in extensions
Dreamweaver checks Configuration/Extensions during startup. If it encounters an extension file
within the folder, Dreamweaver processes the JavaScript by completing the following steps:
• Compiling everything between the opening and closing SCRIPT tags.
• Executing any code within SCRIPT tags that is not part of a function declaration.
Note: This procedure is necessary during startup because some extensions may require initialization of global
variables.
For any external JavaScript files that are specified in the SRC attributes of SCRIPT tags,
Dreamweaver performs the following actions:
• Reads in the file
• Compiles the code
• Executes the procedures
Note: If any JavaScript code in your extension files contains the string ’</SCRIPT>’, the JavaScript
interpreter reads this as an actual closing
SCRIPT tag and reports an unterminated string literal error.
To avoid this problem, break the string into pieces and concatenate them, as shown in the following example:
’<’ + ’/SCRIPT>’.
Dreamweaver executes code in the onLoad event handler (if one appears in the BODY tag) when
the user chooses the command or action from a menu for the following extension types:
• Command
• Behavior action
Dreamweaver executes code in the
onLoad event handler on the BODY tag if the body of the
document contains a form for object extensions.
Dreamweaver ignores the
onLoad handler on the BODY tag in the following extensions:
• Data translator
• Property inspector
• Floating panel