tnbrwneyez
Programmer
I need to take the following script and modify it to assign a separate specific code to the browser variable for 3.x version of IE or Netscape.
<html>
<head>
<title>Browser Detection</title>
<script language="JavaScript" type="text/javascript">
//check for 5.0 or later browsers
if (parseInt(navigator.appVersion) >= 5
|| navigator.appVersion.indexOf("MSIE 5") != -1) {
browser="DOM";
} else if (navigator.userAgent.indexOf("Mozilla/4") != -1)
{
if (navigator.appName.indexOf("Netscape") != -1)
browser="NS4";
if (navigator.appVersion.indexOf("MSIE 4") != -1)
browser="IE";
} else browser="Other";
</script>
</head>
<body>
<h1>Browser Detection Example</h1>
<script language="JavaScript" type="text/javascript">
document.write("browser detected: " + browser + "<br>");
</script>
</body>
</html>
Please help!
Thanks
<html>
<head>
<title>Browser Detection</title>
<script language="JavaScript" type="text/javascript">
//check for 5.0 or later browsers
if (parseInt(navigator.appVersion) >= 5
|| navigator.appVersion.indexOf("MSIE 5") != -1) {
browser="DOM";
} else if (navigator.userAgent.indexOf("Mozilla/4") != -1)
{
if (navigator.appName.indexOf("Netscape") != -1)
browser="NS4";
if (navigator.appVersion.indexOf("MSIE 4") != -1)
browser="IE";
} else browser="Other";
</script>
</head>
<body>
<h1>Browser Detection Example</h1>
<script language="JavaScript" type="text/javascript">
document.write("browser detected: " + browser + "<br>");
</script>
</body>
</html>
Please help!
Thanks