Getserverlanguages() – Adobe Extending Dreamweaver CS4 User Manual
Page 331

325
EXTENDING DREAMWEAVER CS4
Server models
Description
This function returns a JavaScript object that can be accessed from within the JavaScript code. You can retrieve this
object by calling the
dom.serverModel.getServerInfo()
JavaScript function. Furthermore,
serverName
,
serverLanguage
, and
serverVersion
are special properties, which you can access through the following JavaScript
functions:
dom.serverModel.getServerName()
dom.serverModel.getServerLanguage()
dom.serverModel.getServerVersion()
Arguments
None.
Returns
Dreamweaver expects an object that contains the properties of your server model.
Example
var obj = new Object();
obj.serverName = "ASP";
obj.serverLanguage = "JavaScript";
obj.serverVersion = "2.0";
...
return obj;
getServerLanguages()
Availability
Dreamweaver UltraDev 1, deprecated in Dreamweaver MX.
Description
This function returns the supported scripting languages of a server model with an array of strings. Dreamweaver uses
these strings to populate the Default Scripting Language list that is found in the App Server category in the Site
Definition dialog box.
Note: The Default Scripting Language list exists only in Dreamweaver 4 and earlier. For Dreamweaver MX and later, the
Site Definition dialog box does not list supported scripting languages, nor does Dreamweaver use the
getServerLanguages()
function. Dreamweaver does not use this function because each server model has only one
server language in Dreamweaver.
In earlier versions of Dreamweaver, a server model could support multiple scripting languages; for example, the ASP
server model supports JavaScript and VBScript.
If you want a file in the ServerFormats folder to apply only to a specific scripting language, add the following statement
so it is the first line in the HTML file:
In this example,
XXX
represents the scripting language. This statement causes the server behavior to appear in the Plus
(+) menu of the Server Behaviors panel only when the currently selected scripting language is
XXX
.
Arguments
None.