Site.getsites(), Site.getsiterootforurl() – Adobe Dreamweaver API Reference CS5 User Manual
Page 240

235
DREAMWEAVER API REFERENCE
Site
Last updated 8/27/2013
Arguments
fileURL
•
The fileURL argument is the fully qualified URL (including the string "file://") for a named file.
Returns
A string that contains the name of the site, if any, in which the specified file exists. The string is empty when the
specified file does not exist in any defined site.
site.getSites()
Availability
Dreamweaver 3.
Description
Gets a list of the defined sites.
Arguments
None.
Returns
An array of strings that represents the names of the defined sites, or an empty array if no sites are defined.
site.getSiteRootForURL()
Availability
Dreamweaver CS4.
Description
Gets the local root folder of the site associated with a specific file URL.
Arguments
fileURL
•
The
fileURL
argument is a string argument that contains the fully qualified URL (including the string
file://
)
for a named file.
Returns
A string that contains the local root folder of the site, expressed as a
file://URL
, in which the specified file exists. The
string is empty when the specified file does not exist in any defined site.
Example
var dom = dw.getDocumentDOM();
var siteRoot = site.getSiteRootForURL(dom.URL);