FP98: Sample JavaScript Code to Redirect Page Based on Browser

Article translations Article translations
Article ID: 193057 - View products that this article applies to.
This article was previously published under Q193057
This article has been archived. It is offered "as is" and will no longer be updated.

For a Microsoft FrontPage 97 version of this article, see 193063.
Expand all | Collapse all

Summary

This article provides sample JavaScript that redirects a Web browser to a specific page based on which browser you are using.

More information

NOTE: The following JavaScript has been tested in Microsoft Internet Explorer versions 3.0 and 4.0 and Netscape Navigator versions 3.0 and 4.0.

To redirect the browser using a script, follow these steps:
  1. Start FrontPage Editor and open the HTML page you want to edit.
  2. On the Insert menu, point to Advanced and then click Script.
  3. In the Language section, click JavaScript.
  4. In the Script box, type the following script:
    var version = navigator.appVersion;
          // sets variable = browser version
          if (version.indexOf("MSIE") != -1)
          // checks to see if using IE
             {
             window.location.href="ie.htm"
             /* If using IE, it shows this page
             replace ie.htm with page name */ 
          }else
          window.open("other.htm", target="_self")
          /* else open other page
          replace other.html with page name */ 
    						
  5. Click OK.
  6. On the File menu, click Save.
  7. Open the page in a Web browser that supports client-side scripting.

References

For more information about JavaScript, please see the following Microsoft World Wide Web site:
http://www.microsoft.com/scripting/jscript/default.htm

Properties

Article ID: 193057 - Last Review: October 26, 2013 - Revision: 2.0
Applies to
  • Microsoft FrontPage 98 Standard Edition
Keywords: 
kbnosurvey kbarchive kbcode kbhowto kbhtml kbusage KB193057

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com