First open Dreamweaver and make a new page. Go to Window
> Behaviors if your behaviors panel is
not open. Then click on the +
sign and choose Check Browser

You will be shown this window when you choose the Check
BrowserOption.

Here you should make your choices, I have chosen here if the Browser is:
Netscapte Navigator 4.0 and later - go to www.yahoo.com and if it is Netscape Navigator < 4.0 - go to www.google.com
After you make your selection Click OK
Make sure onLoad option
is chosen under the Events, we want users to be redirected
when this page loads.

You are done, preview your page and see where you are redirected based on your Browser Type.
You could as well redirect all the users who are using Netscape
Navigator to one page and Internet Explorer user to other.
This way if you have two versions of you website for specific
browser types, you could redirect them to respectie pages
which are viewed best by their specific browser types. It
is matter of how you use this script.
Another option is redirect all four options to one page,
then it would become a normal redirection script that redirects
all the users to one specific page.
Here is the code that is generated by Dreamweaver after this tutorial:
| <!DOCTYPE HTML PUBLIC "-//W3C//DTD
HTML 4.01 Transitional//EN"> <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <script language="JavaScript" type="text/JavaScript"> <!-- function MM_checkBrowser(NSvers,NSpass,NSnoPass,IEvers,IEpass,IEnoPass,OBpass,URL,altURL) { //v4.0 var newURL='', verStr=navigator.appVersion, app=navigator.appName, version = parseFloat(verStr); if (app.indexOf('Netscape') != -1) { if (version >= NSvers) {if (NSpass>0) newURL=(NSpass==1)?URL:altURL;} else {if (NSnoPass>0) newURL=(NSnoPass==1)?URL:altURL;} } else if (app.indexOf('Microsoft') != -1) { if (version >= IEvers || verStr.indexOf(IEvers) != -1) {if (IEpass>0) newURL=(IEpass==1)?URL:altURL;} else {if (IEnoPass>0) newURL=(IEnoPass==1)?URL:altURL;} } else if (OBpass>0) newURL=(OBpass==1)?URL:altURL; if (newURL) { window.location=unescape(newURL); document.MM_returnValue=false; } } //--> </script> </head> <body onLoad="MM_checkBrowser(4.0,1,2,4.0,1,2,2,'www.yahoo.com','www.google.com');return
document.MM_returnValue"> |