![MACROMEDIA DREAMWEAVER 8-DREAMWEAVER API Скачать руководство пользователя страница 312](http://html1.mh-extra.com/html/macromedia/dreamweaver-8-dreamweaver-api/dreamweaver-8-dreamweaver-api_reference_3332054312.webp)
312
Document
Examples
The following example uses the
dreamweaver.getDocumentDOM()
function to access 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();
dreamweaver.getNewDocumentDOM()
Availability
Dreamweaver MX; added
documentType
argument in Dreamweaver 8.
Description
Provides access to the editable tree for a new, empty document. This function works in the
same way as the
getDocumetDOM()
function, except that it points to a new document, not an
existing one, and does not open the document.
Arguments
{documentType}
■
The
documentType
argument is a string. Its value must be a document type specified in
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();
NO
TE
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.
000_DW_API_Print.book Page 312 Wednesday, July 20, 2005 11:58 AM
Содержание DREAMWEAVER 8-DREAMWEAVER API
Страница 1: ...Dreamweaver API Reference...
Страница 16: ......
Страница 28: ...28 The File I O API...
Страница 38: ...38 The HTTP API...
Страница 68: ...68 Flash Integration...
Страница 100: ...100 The Database API...
Страница 116: ...116 The JavaBeans API...
Страница 144: ...144 The Source Control Integration API...
Страница 146: ......
Страница 254: ...254 Workspace...
Страница 298: ...298 Site...
Страница 354: ...354 Document...
Страница 396: ...396 Page Content...
Страница 488: ...488 Design...
Страница 550: ...550 Code...