Check Browser

Check Browser

Use the Check Browser action to send visitors to different pages depending on their browser brands and versions. For example, you might want visitors to go to one page if they have Netscape Navigator 4.0 or later, to go to another page if they have Internet Explorer 4.0 or later, and to stay on the current page if they have any other kind of browser.

It’s useful to attach this behavior to the body tag of a page that is compatible with practically any browser (and that does not use any other JavaScript); this way, visitors who come to the page with JavaScript turned off will still see something.

Another option is to attach this behavior to a null link (such as <a href="javascript:;">) and have the action determine the link’s destination based on the visitor’s browser brand and version.

To use the Check Browser action:

  1. Select an object and open the Behaviors panel.
  2. Click the Plus (+) button and select Check Browser from the Actions pop-up menu.
  3. Determine how you want to separate your visitors: by browser brand, by browser version, or both.

    For example, do you want everyone with a 4.0 browser to see one page, and all others to see a different page? Or perhaps you want Netscape Navigator users to see one page and Internet Explorer users to see another.

  4. Specify a version of Netscape Navigator.
  5. In the adjacent pop-up menus, select options for what to do if the browser is the Netscape Navigator version you specified or later and what to do otherwise.

    The options are Go to URL, Go to Alt URL, and Stay on This Page.

  6. Specify a version of Internet Explorer.
  7. In the adjacent pop-up menus, select options for what to do if the browser is the Internet Explorer version you specified or later and what to do otherwise.

    The options are Go to URL, Go to Alt URL, and Stay on This Page.

  8. Select an option from the Other Browsers pop-up menu to specify what to do if the browser is neither Netscape Navigator nor Internet Explorer. (For example, the visitor may be using a text-based browser like Lynx.)

    Stay on This Page is the best option for browsers other than Netscape Navigator and Internet Explorer because most do not support JavaScript--and if they cannot read this behavior, they will stay on the page anyway.

  9. Enter the paths and filenames of the URL and the alternate URL in the text boxes at the bottom of the dialog box. If you enter a remote URL, you must enter the http:// prefix in addition to the www address.
  10. Click OK.
  11. Check that the default event is the one you want.

    If it isn’t, select another event from the pop-up menu. If the events you want are not listed, change the target browser in the Show Events For pop-up menu. Remember that the purpose of this behavior is to check for different browser versions, so it’s best to select an event that works on 3.0 and later browsers.



Getting Started with Dreamweaver
Dreamweaver Basics
Working with Dreamweaver Sites
Laying Out Pages
Adding Content to Pages
Inserting and Formatting Text
Adding Audio, Video, and Interactive Elements
Working with Page Code
Preparing to Build Dynamic Sites
Making Pages Dynamic
Developing Applications Rapidly