Specifications
Chapter 18218
Note: All Dreamweaver MX-defined server models return a value of 1 so third-party server models can override the
file-extension association.
Arguments
dom
dom
is the Macromedia document object, which is returned by the function
dreamweaver.getDocumentDOM().
Returns
Dreamweaver expects an integer that indicates the priority that the developer gives to the server
model for the file extension. This function should return a value of
-1 if the server model does
not claim the file extension; otherwise, this function should return a value greater than zero.
Example
In the following example, if the user opens a JavaScript document for the current server model,
the sample code returns a value of 2. This value lets the developer’s server model take precedence
over that of Macromedia.
var retVal = -1;
var langRE = /@\s*language\s*=\s*(\"|\’)?javascript(\"|\’)?/i;
// Search for the string language="javascript"
var oHTML = dom.documentElement.outerHTML;
if (oHTML.search(langRE) > -1)
retVal = 2;
return retVal;
getFileExtensions()
Availability
Dreamweaver UltraDev 1, deprecated in Dreamweaver MX
Description
Returns the document file extensions with which a server model can work. For example, the ASP
server model supports .asp and .htm file extensions. This function returns an array of strings, and
Dreamweaver uses these strings to populate the Default Page Extension list that is found in the
App Server category of the Site Definition dialog box.
Note: The Default Page Extension list exists only in Dreamweaver 4 and earlier. For Dreamweaver MX, the Site
Definition dialog box does not list file extension settings. Instead, Dreamweaver MX reads the Extensions.txt file and
parses the <documenttype> element in the mmDocumentTypes.xml file. (For more information on these two files
and the <documenttype> element, see “Extensible document types in Dreamweaver” on page 22.)
Arguments
None.
Returns
Dreamweaver expects an array of strings that represent the allowed file extensions.