Examples
The following example uses the
current document:
var theDOM = dreamweaver.getDocumentDOM("document");
In the following example, the current document DOM identifies a selection and pastes it at
the end of another document:
var currentDOM = dreamweaver.getDocumentDOM('document');
currentDOM.setSelection(100,200);
currentDOM.clipCopy();
var otherDOM = dreamweaver.openDocument(dreamweaver.¬
getSiteRoot() + "html/foo.htm");
otherDOM.endOfDocument();
otherDOM.clipPaste();
The openDocument() argument is used because DOM methods normally operate only on
open documents. Running a function on a document that isn't open causes a
Dreamweaver error. The DOM methods that can operate only on the active document or
on closed documents indicate this fact in their descriptions.
dreamweaver.getNewDocumentDOM()
Availability
Dreamweaver MX; added
Description
Provides access to the editable tree for a new, empty document. This function works in the
same way as the
getDocumetDOM()
existing one, and does not open the document.
Arguments
{documentType}
The
documentType
the DocumentTypes.xml file.
Returns
A pointer to a new, empty document.
Example
The following code returns the DOM for a new, empty document:
var theDOM = dreamweaver.getNewDocumentDOM();
312
Document
dreamweaver.getDocumentDOM()
argument in Dreamweaver 8.
documentType
function, except that it points to a new document, not an
argument is a string. Its value must be a document type specified in
function to access the
Need help?
Do you have a question about the DREAMWEAVER 8-DREAMWEAVER API and is the answer not in the manual?