A simple behavior example
311
4.
Save the file as netscapecontent.htm in the same directory as the iecontent.htm file.
5.
Restart Dreamweaver.
6.
Create a new HTML file with the following content:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Which browser</title>
</head>
<body>
</body>
</html>
7.
Save the file as whichbrowser.htm in the same directory as the iecontent.htm file.
8.
Click the Plus (+) button on the Behaviors panel and select the Check Browser Band
behavior.
9.
Click the Browse button next to the Go to the URL if the browser is Netscape Navigator
text box, and select the netscapecontent.htm file.
10.
Click the Browse button next to the Go to the URL if the browser is Internet Explorer text
box, and select the iecontent.htm file.
11.
Click OK.
Dreamweaver adds the specified JavaScript to the whichbrowser.htm file, so that the file
appears as follows:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Which browser</title>
<script language="JavaScript" type="text/JavaScript">
<!--
function checkBrowserBrand(netscapeURL,explorerURL) {
if (navigator.appName == "Netscape") {
if (netscapeURL) location.href = netscapeURL;
}else if (navigator.appName == "Microsoft Internet Explorer") {
if (explorerURL) location.href = explorerURL;
}
}
//-->
</script>
</head>
Содержание DREAMWEAVER 8-EXTENDING DREAMWEAVER
Страница 1: ...Extending Dreamweaver...
Страница 8: ...8 Contents...
Страница 14: ...14 Introduction...
Страница 16: ......
Страница 54: ...54 Customizing Dreamweaver...
Страница 96: ...96 Customizing Code View...
Страница 98: ......
Страница 110: ...110 Extending Dreamweaver...
Страница 138: ......
Страница 166: ...166 Insert Bar Objects...
Страница 180: ...180 Commands...
Страница 248: ...248 Toolbars...
Страница 260: ...260 Reports...
Страница 278: ...278 Tag Libraries and Editors...
Страница 288: ...288 Property Inspectors...
Страница 378: ...378 Server Behaviors...
Страница 398: ...398 Data Sources...
Страница 432: ...432 Server Models...
Страница 456: ...456 Data Translators...
Страница 482: ......
Страница 492: ...492 The Shared Folder...