Writing the JavaScript code
Because the first
getDynamicContent()
example:
function getDynamicContent(itemID)
{
var browsers = null;
var PIB = null;
var i;
var j=0;
browsers = new Array();
PIB = dw.getBrowserList();
for (i=0; i<PIB.length; i=i+2)
{
browsers[j] = new String(PIB[i]);
if (dw.getPrimaryBrowser() == PIB[i+1])
browsers[j] += "\tF12";
else if (dw.getSecondaryBrowser() == PIB[i+1])
browsers[j] += "\tCmd+F12";
browsers[j] += ";id='"+escQuotes(PIB[i])+"'";
if (itemID == "DWPopup_PIB_Default")
browsers[j] = MENU_strPreviewIn + browsers[j];
j = j+1;
}
return browsers;
}
The
getDynamicContent()
array of the browser names that have been specified in the Preview in Browser section of
Dreamweaver Preferences. This array contains the name of each browser and the path to the
executable file. Next, for each item in the array
getDynamicContents()
called
browsers
the primary or secondary browser, the function appends the names of the keyboard shortcut keys
that invoke them. Next it appends the string
single quotes (for example,
"
DWPopup_PIB_Default
After it constructs an entry for each browser listed in Preferences, the
function returns the array
Preferences, the function returns the value
in the menu.
tag contains the
menuitem
function in the PIB_Dynamic.js file, which is shown in the following
function calls the
function moves the name of the browser (
(
browsers[j] = new String(PIB[i]);
;id='iexplore')
", the function prefixes the array item with the string
to Dreamweaver. If no browsers have been selected in
browsers
attribute, Dreamweaver calls the
dynamic
dw.getBrowserList()
(i=0; i<PIB.length; i=i+2)
). If the browser has been designated as
followed by the name of the browser in
";id="
. If the
argument is
itemID
, and Dreamweaver displays No Browsers Selected
null
function to obtain an
, the
) into a second array
PIB[i]
Preview in.
getDynamicContent()
A dynamic menu
165
Need help?
Do you have a question about the DREAMWEAVER MX 2004-EXTENDING DREAMWEAVER and is the answer not in the manual?
Questions and answers