Specifications
Chapter 31372
Functions that refer to Dreamweaver are methods of the dreamweaver object. For example,
dreamweaver.closeDocument() is a function of the dreamweaver object and causes
Dreamweaver to close the current document. The
dreamweaver object can be abbreviated as dw.
How this chapter is organized
The methods in the Dreamweaver JavaScript API are grouped functionally, then alphabetically
by object, and then by method name. Each section describes methods of the
dom object, the site
object, or the
dreamweaver object. For example, methods that deal with creating, applying, and
deleting cascading style sheet (CSS) styles are grouped under CSS Styles functions; CSS
dom
methods are listed first, and then they are followed by CSS
dreamweaver methods. Enablers are
listed in the Enablers section. Deprecated functions are listed in a section at the end of the
chapter. Optional arguments are enclosed in braces ({ }).
About enablers
The functions in the JavaScript API can perform any task that the user can perform using the
Dreamweaver user interface. However, certain functions do not work under specific conditions.
Calling a function through JavaScript when those conditions exist generates one or more
JavaScript errors. Enablers check the current context to see whether conditions exist that would
generate a JavaScript error if the associated function is called. For example,
site.canGet()
checks whether Dreamweaver can perform a Get operation on the
site object (site.get()).
When a function in the Dreamweaver JavaScript API has an enabler, the enabler is listed with the
function and documented in “Enablers” on page 409. Many functions do not require enablers,
because the menu item that is associated with the function is always enabled, because the function
is unrelated to menus, or because an enabler would duplicate the function of an existing API
function. For example, functions that require the use of a current document often do not require
an enabler because you can use
dw.getDocumentDOM()!=null to test the current context.
Assets panel functions
Assets panel functions, which are programmed into the API as an asset panel, let you manage and
use the elements in the Assets panel (templates, libraries, images, Macromedia Shockwave and
Flash movies, URLs, colors, movies, and scripts).
dreamweaver.assetPalette.addToFavoritesFromDocument()
Availability
Dreamweaver 4
Description
Adds the element that is selected in the Document window to the Favorites list. This function
handles only images, movies, Shockwave files, Flash files, text font colors, and URLs.
Arguments
None.
Returns
Nothing.