User Guide
74 Chapter 4: The Dreamweaver Document Object Model
Properties and methods of comment objects
A JavaScript object represents each HTML comment. The following table details the properties
and methods of comment objects that are taken from DOM Level 1 and are used in
Dreamweaver. A bullet (•) marks read-only properties.
The dreamweaver and site objects
Dreamweaver implements the standard objects that are accessible through the DOM and adds
two custom objects:
dreamweaver and site. These custom objects are widely used within the
APIs and in writing extensions. For more information on the methods of the
dreamweaver and
site objects, see the Dreamweaver API Reference.
Properties of the dreamweaver object
The
dreamweaver object has two read-only properties, which are described in the following list:
• The appName property has the value "Dreamweaver".
• The appVersion property has a value of the form
"versionNumber.releaseNumber.buildNumber [languageCode] (platform)".
As an example, the value of the
appVersion property for the Swedish Windows version of
Dreamweaver MX 2004 is
"7.0.XXXX [se] (Win32)"; the value for the English Macintosh
version is
"7.0.XXXX [en] (MacPPC)".
Note: You can find the version and build number by selecting the Help > About menu item.
The appName and appVersion properties were implemented in Dreamweaver 3 and are not
available in earlier versions of Dreamweaver. You might want to check that the user of your
extension has Dreamweaver version 3 or later by checking for the existence of the
appVersion or
appName property.
To find the specific version of Dreamweaver, check first for the existence of appVersion and then
for the version number, as shown in the following example:
if (dreamweaver.appVersion && ¬
dreamweaver.appVersion.indexOf('3.01') != -1){
// execute code
}
Property or method Return value
nodeType •
Node.COMMENT_NODE
parentNode •
The parent tag
childNodes •
An empty NodeList array
data
The text string between the comment markers
(
<!-- and -->)
hasChildNodes() false