FP2000: Sample JavaScript Code to Redirect Page Based on BrowserID: Q208649
|
This article provides sample JavaScript that redirects a Web browser to a specific page based on which browser you are using.
WARNING: ANY USE BY YOU OF THE CODE PROVIDED IN THIS ARTICLE IS AT YOUR OWN RISK. Microsoft provides this code "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.
NOTE: The following JavaScript has been tested in Microsoft Internet Explorer versions 3.0, 4.0, 5.0 and Netscape Navigator versions 3.0, 4.0, and 4.5.
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 */
For more information about Microsoft JScript, please see the following Microsoft World Wide Web site:
http://www.microsoft.com/scripting/jscript/default.htm
Additional query words: 98 fpscript JavaScript Redirect browser
Keywords : kbcode kbusage kbhtml fpedit fphtml fpscript kbInternet
Version : WINDOWS:
Platform : WINDOWS
Issue type : kbhowto
Last Reviewed: July 1, 1999