142
Chapter 11: Application
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 142
.
dreamweaver.getBrowserList()
Availability
Dreamweaver 3.
Description
Gets a list of all the browsers in the File > Preview in Browser submenu.
Arguments
None.
Returns
An array that contains a pair of strings for each browser in the list. The first string in each pair is
the name of the browser, and the second string is its location on the user’s computer, which is
expressed as a file:// URL. If no browsers appear in the submenu, the function returns nothing.
dreamweaver.getExtensionEditorList()
Availability
Dreamweaver 3
Description
Gets a list of editors for the specified file from the External Editors preferences.
000_DW_API_Print.book Page 142 Wednesday, August 20, 2003 9:14 AM
Summary of Contents for DREAMWEAVER MX 2004-DREAMWEAVER API
Page 1: ...Dreamweaver API Reference...
Page 24: ...24 Contents...
Page 32: ......
Page 70: ...70 Chapter 5 Fireworks Integration...
Page 76: ...76 Chapter 6 Flash Integration...
Page 116: ...116 Chapter 9 The JavaBeans API...
Page 140: ......
Page 152: ...152 Chapter 11 Application...
Page 218: ...218 Chapter 12 Workspace...
Page 248: ...248 Chapter 13 Site...
Page 292: ...292 Chapter 14 Document...
Page 378: ...378 Chapter 17 Design...
Page 430: ...430 Chapter 18 Code...
Page 486: ...486 Index...