The Document Object Model and JavaScript > The document object model in Dreamweaver > The dreamweaver object and its properties |
The dreamweaver object and its properties
Dreamweaver implements the standard objects as defined by the browsers and the W3C, as well as two custom objects: dreamweaver and site. The dreamweaver object has two read-only properties associated with it: appName and appVersion.
appName has the value "Dreamweaver" or "Dreamweaver Ultradev" for each respective application. appVersion has a value of the form "versionNumber [languageCode] (platform)". For example, the value of the appVersion property for the Swedish Windows version of Dreamweaver 4 would be "4.0 [se] (Win32)"; the value for the English Macintosh version would be "4.0 [en] (MacPPC)".
The appName and appVersion properties were implemented in Dreamweaver 3 and are not available in earlier versions of Dreamweaver. To determine whether the version of Dreamweaver is 3 or later, you can simply check for the existence of the appVersion or appName property. To check for a specific version of Dreamweaver, check first for the existence of appVersion and then for the version number. For example:
if (dreamweaver.appVersion && dreamweaver.appVersion.indexOf('3.01') != -1){
// execute code
}
The site object has no properties. For more information about the methods of the dreamweaver and site objects, see The JavaScript API overview.