Specifications
Chapter 442
For example, to refer to the first image in the active document you can write
dw.getDocumentDOM().images[0]. You can also store the document object in a variable and use
that variable in future references, as shown in the following example:
var dom = dw.getDocumentDOM(); //get the dom of the current document
var firstImg = dom.images[0];
firstImg.src = “myImages.gif”;
This kind of notation is common in files throughout the Configuration folder, especially in
command files. For more information about
dw.getDocumentDOM(), see
“dreamweaver.getDocumentDOM()” on page 453.
The Dreamweaver DOM
The Dreamweaver DOM contains a subset of objects, properties, and methods from the World
Wide Web Consortium (W3C) (http://www.w3.org/TR/REC-DOM-Level-1/) DOM Level 1,
which are combined with some properties of the Microsoft Internet Explorer 4.0 DOM.
Objects, properties, and methods of the Dreamweaver DOM
The following table lists the objects, properties, methods, and events that the Dreamweaver
DOM supports. Some properties are read-only when they are accessed as properties of a specific
object. A bullet (•) indicates properties that are read-only when used in the listed context.
Object Properties Methods Events
window navigator •
document •
innerWidth •
innerHeight •
screenX •
screenY •
alert()
confirm()
escape()
unescape()
close()
setTimeout()
clearTimeout()
setInterval()
clearInterval()
resizeTo()
onResize
navigator platform • None None
document forms • (an array of form
objects)
images • (an array of image
objects)
layers • (an array of
LAYER, ILAYER, and
absolutely positioned DIV
and SPAN objects)
child objects by name •
nodeType •
parentNode •
childNodes •
documentElement •
body •
URL •
parentWindow •
getElementsBy TagName()
hasChildNodes()
onLoad