< Day Day Up > |
Global document functions act on an entire document. They check spelling, check target browsers, set page properties, and determine correct object references for elements in the document. dom.checkSpelling()Availability Dreamweaver 3. Description Checks the spelling in the document, opening the Check Spelling dialog box if necessary, and notifies the user when the check is complete. Arguments None. Returns Nothing. dom.checkTargetBrowsers()Availability Dreamweaver 3. Description Runs a target browser check on the document. To run a target browser check on a folder or group of files, see "site.checkTargetBrowsers()" on page 770. Arguments None. Returns Nothing. dom.getParseMode()Availability Dreamweaver MX 2004 Description Gets the current parsing mode of the document, which controls how the document is validated and whether it shows up in the main document window as HTML. Arguments None. Returns A string that specifies the current parsing mode: "html", "xml", "css", or "text". dom.hideInfoMessagePopup()Availability Dreamweaver MX 2004. Description Hides the tooltip-like message, if it is visible, for the document window. Arguments None. Returns Nothing. See also "dom.showInfoMessagePopup()" on page 828. dom.runValidation()Availability Dreamweaver MX, optional arguments added in Dreamweaver MX 2004. Description Runs the Validator on a single specified document (this function is similar to site.runValidation()). The Validator checks the document for conformance with the language specified in the document doctype (such as HTML 4.0 or HTML 3.2) and the language specified by the server model (such as ColdFusion or ASP). If the document has no doctype, then the Validator uses the language setting specified in the Validator section of the Preferences dialog box. Arguments {controlString}, {bOpenResultsWindow}, {bShowInfoMessage}
Returns The Validation results window object. Example The following example runs a regular validation when the user selects the File > Check Page > Validate Markup menu option (or Validate Current Document in the Validation panel): dw.getDocumentDOM().runValidation(''); The following example prompts the user to save an unsaved document, runs an automatic validation, does not open the Validation results window, but does show the total number of errors over the document toolbar button for DW_ValidatorErrors: dw.getDocumentDOM().runValidation('auto-explicit', false, true); The following example does not prompt the user to save an unsaved document. If the document has not been saved, the validation will not start. If the document has been saved, Dreamweaver runs an automatic validation, does not open the Validation results window, and does not indicate the total number of errors encountered on the document toolbar: dw.getDocumentDOM().runValidation('auto-implicit', false); dom.showInfoMessagePopup()Availability Dreamweaver MX 2004. Description Shows a tooltip-like message in the document window or under a toolbar item. Arguments location, message, timeout
Returns Nothing. Example The following example displays two tooltip messages. The first line of code displays the message "This message is in the center" in the center of the document. The second call to showInfoMessagePopup() displays the tooltip message "Don't forget the title for the Window" for the Title text edit box, which has the ID DW_SetTitle, on the toolbar with the ID DW_Toolbar_Main. dw.getDocumentDOM.showInfoMessagePopup('', 'This message is in the center', 5000); dw.getDocumentDOM.showInfoMessagePopup('toolbar:DW_Toolbar_Main:DW_SetTitle', 'Don't forget the title for the window', 5000); See also "dom.hideInfoMessagePopup()" on page 826. dom.showPagePropertiesDialog()Availability Dreamweaver 3. Description Opens the Page Properties dialog box. Arguments None. Returns Nothing. dreamweaver.doURLDecoding()Availability Dreamweaver MX. Description Uses the internal Dreamweaver URL decoding mechanism to decode special characters and symbols in URL strings. For example, this function decodes %20 to a space character and the name " to ". Arguments inStr
Returns A string that contains the decoded URL. Example The following example calls dw.doURLDecoding() to decode the special characters in its argument and store the resulting string in outstr: outStr = dreamweaver.doURLDecoding("http://maps.yahoo.com/py/ddResults .py?Pyt=Tmap&tarname=&tardesc=&newname=&newdesc=&newHash=&newTHash=&newSts=&newTSts=&tlt=&tln=&slt=&sln=&newFL=Use+Address+Below&newaddr=2000+Shamrock+Rd&newcsz=Metroo+Park%2C+CA&newcountry=us&newTFL=Use+Address+Below&newtaddr=500+El+Camino&newtcsz=Santa+Clara%2C+CA&newtcountry=us&Submit=Get+Directions") dreamweaver.getElementRef()Availability Dreamweaver 2. Description Gets the Netscape Navigator or Internet Explorer object reference for a specific tag object in the DOM tree. Arguments NSorIE, tagObject
Returns A string that represents a valid JavaScript reference to the object, such as document.layers['myLayer']. The string is subject to the following conditions:
dreamweaver.getObjectRefs() (deprecated)Availability Dreamweaver 1; deprecated in 3. Description This function scans the specified document for instances of the specified tags or, if no tags are specified, for all tags in the document and formulates browser-specific references to those tags. This function is equivalent to calling getElementsByTagName() and then calling dreamweaver.getElementRef() for each tag in the nodelist. Arguments NSorIE, sourceDoc, {tag1}, {tag2},...{tagN}
Returns An array of strings where each array is a valid JavaScript reference to a named instance of the requested tag type in the specified document (for example, "document.myLayer.document.myImage") for the specified browser:
When the same list of arguments passes to getObjectTags(), the two functions return arrays of the same length and with parallel content. dreamweaver.getObjectTags() (deprecated)Availability Dreamweaver1; deprecated in 3. Description This function scans the specified document for instances of the specified tags or, if no tags are specified, for all tags in the document. This function is equivalent to calling getElementsByTagName() and then getting outerHTML for each element in the nodelist. Arguments sourceDoc, {tag1}, {tag2},...{tagN}
Returns An array of strings where each array is the source code for an instance of the requested tag type in the specified document.
When the same list of arguments passes to getObjectRefs(), the two functions return arrays of the same length. Example dreamweaver.getObjectTags("document", "IMG"), depending on the contents of the active document, might return an array with the following items:
dreamweaver.getPreferenceInt()Availability Dreamweaver MX. Description Lets you retrieve an integer preference setting for an extension. Arguments section, key, default_value
Returns Integer value of the specified entry in the specified section or the default value if the function does not find the entry. Returns 0 if the value of the specified entry is not an integer. Example The following example returns the integer value of the Snap Distance setting in the My Extension section of Preferences. If there is no MyExtension section or no Snap Distance entry, the function returns the specified default value of 0. var snapDist; //default value if entry not found snapDist = dreamweaver.getPreferenceInt("My Extension", "Snap Distance", 0); dreamweaver.getPreferenceString()Availability Dreamweaver MX. NOTE To access the preferences for sites, you must have version 7.0.1. Check dw.appVersion for the correct version before accessing site information. Description Lets you retrieve a string preference setting that you stored for an extension. Arguments section, key, default_value
Returns The requested preference string, or if the string cannot be found, the default value. Example The following example returns the String value of the Text Editor setting in the My Extension section of Preferences. If there is no MyExtension section or no Text Editor entry, the function returns the default value specified by the variable txtEditor. var txtEditor = getExternalTextEditor(); //set default text Editor value txtEditor = dreamweaver.getPreferenceString("My Extension", "Text Editor", txtEditor); dreamweaver.setPreferenceInt()Availability Dreamweaver MX. Description Lets you set an integer preference setting for an extension. This setting is stored with Dreamweaver preferences when Dreamweaver is not running. Arguments section, key, new_value
Returns A TRue value if successful; false otherwise. Example The following example sets the Snap Distance entry to the value of the variable snapDist in the My Extension category of Preferences: var snapDist = getSnapDistance(); if(snapDist > 0) { dreamweaver.setPreferenceInt("My Extension", "Snap Distance", snapDist); } dreamweaver.setPreferenceString()Availability Dreamweaver MX. NOTE To access the preferences for sites, you must have version 7.0.1. Check dw.appVersion for the correct version before accessing site information. Description Lets you write a string preference setting for an extension. This setting is stored with Dreamweaver preferences when Dreamweaver is not running. Arguments section, key, new_value
Returns A true value if successful; false otherwise. Example var txtEditor = getExternalTextEditor(); dreamweaver.setPreferenceString("My Extension", "Text Editor", txtEditor); dreamweaver.showTargetBrowsersDialog()Availability Dreamweaver MX 2004. Description Opens the Target Browsers dialog box. The Target Browsers dialog box lets a user specify which browser versions the Browser Target Check feature should use for checking the current page's browser compatibility issues. Arguments None. Returns Nothing. |
< Day Day Up > |