SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 1913 | Next

Joseph W. Lowery

"Dreamweaver CS3 Bible"

getDocumentDOM(???document???);
theDom holds the DOM of the current document and, by extension, everything connected to it.
Because many behaviors require repeated access to the DOM, it??™s good practice to assign it to
a global variable (such as theDOM) early on in your script.
After you have accessed the document DOM in this manner, you can request more specific information. If,
for example, you want to examine the of the current document, you can code it this way:
var theDom = dreamweaver.getDocumentDOM(???document???);
var theBody = theDom.body;
You could also use JavaScript dot notation to shorten the code:
var theBody = dreamweaver.getDocumentDOM(???document???).body;
The getDocumentDOM() function requires one argument, sourceDoc, which refers to the source document.
The argument must be one of the following:
n ???document?????”Sets the reference to the current document. Although the ???document??? argument
can be used from anywhere to read the DOM, any edits applied using it must ultimately be
called from within the applyBehavior(), deleteBehavior(), or objectTag()
functions??”or any function in a command or Property inspector file.
n ???parent?????”Sets the source document to the parent of the current document. This argument is
generally used to determine if a document is within a frameset, like this:
var frameset = dreamweaver.


Pages:
1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925