MACROMEDIA DREAMWEAVER MX 2004-EXTENDING DREAMWEAVER Spezifikationen Seite 128

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 504
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 127
128 The Dreamweaver Document Object Model
Which document DOM?
It is important to distinguish between the DOM of the user’s document and the DOM of the
extension. The information in this chapter applies to both types of Dreamweaver documents,
but the way that you reference each DOM is different.
If you are familiar with JavaScript in browsers, you can reference objects in the active
document by writing
document. (for example, document.forms[0]), the same way that you
reference objects in extension files. To reference objects in the user’s document, however, you
must call
dw.getDocumentDOM(), dw.createDocument(), or another function that returns a
user document object.
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 the
dw.getDocumentDOM() method, see the
dreamweaver.getDocumentDOM() function in the Dreamweaver API Reference.
The Dreamweaver DOM
The Dreamweaver DOM contains a subset of objects, properties, and methods from the
World Wide Web Consortium (W3C) (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.
Seitenansicht 127
1 2 ... 123 124 125 126 127 128 129 130 131 132 133 ... 503 504

Kommentare zu diesen Handbüchern

Keine Kommentare