User Guide

148 Application
The browser argument, which was added in Dreamweaver 3, specifies a browser. This
argument can be the name of a browser, as defined in the Preview in Browser preferences
or either
'primary' or 'secondary'. If the argument is omitted, the URL opens in the
user’s primary browser.
Returns
Nothing.
Example
The following function uses the dreamweaver.browseDocument() function to open the
Hotwired home page in a browser:
function goToHotwired(){
dreamweaver.browseDocument('http://www.hotwired.com/');
}
In Dreamweaver 4, you can expand this operation to open the document in Microsoft
Internet Explorer using the following code:
function goToHotwired(){
var prevBrowsers = dw.getBrowserList();
var theBrowser = "";
for (var i=1; i < prevBrowsers.length; i+2){
if (prevBrowsers[i].indexOf('Iexplore.exe') != -1){
theBrowser = prevBrowsers[i];
break;
}
}
dw.browseDocument('http://www.hotwired.com/',theBrowser);
}
For more information on the dreamweaver.getBrowserList() function, see
dreamweaver.getBrowserList()” on page 148.
dreamweaver.getBrowserList()
Availability
Dreamweaver 3.
Description
Gets a list of all the browsers in the File > Preview in Browser submenu.
Arguments
None.
000_DW_API_Print.book Page 148 Wednesday, July 20, 2005 11:58 AM