Detecting Browser Type

Source Resulting Output
<SCRIPT LANGUAGE="JavaScript">
<!--
  window.onerror = null;
  manufacturer = navigator.appName;
  versionNum = parseFloat(navigator.appVersion);
  document.write(manufacturer);
  document.write(" ");
  document.write(versionNum);
//-->
</script>

Return to HTML index
 



Detecting Operating System

Source Resulting Output
<SCRIPT LANGUAGE="JavaScript">
<!--
var OpSys = "Unknown";
var OpSysVer = " ";

if (navigator.userAgent.indexOf('Win') != -1) {
     OpSys = "Windows";
if (navigator.userAgent.indexOf('95') != -1) {
       OpSysVer = "95";
     } else if (navigator.userAgent.indexOf('98') != -1) {
       OpSysVer = "98";
     } else if (navigator.userAgent.indexOf('ME') != -1) {
       OpSysVer = "ME";
     } else if(navigator.userAgent.indexOf('NT 4.0') != -1) {
       OpSysVer = "NT";
     }else if (navigator.userAgent.indexOf('NT 5.0') != -1) {
       OpSysVer = "2000";
     } else if(navigator.userAgent.indexOf('NT 5.1') != -1) {
       OpSysVer = "XP";
     }
   } else if (navigator.userAgent.indexOf('Linux') != -1) {
     OpSys = "Linux";
   } else if (navigator.userAgent.indexOf('Mac') != -1) {
     OpSys = "Macintosh";
   } else if (navigator.userAgent.indexOf('SunOS') != -1) {
     OpSys = "UNIX";
     OpSysVer = "SunOS";
   }

document.write("Operating System = ");
document.write(OpSys);
document.write(" ");
document.write(OpSysVer);
//-->
 </script>

Return to HTML index
 


Navigator Object

Source Resulting Output
<SCRIPT LANGUAGE="JavaScript">
<!--
  document.write("navigator.appName = '");
  document.write(navigator.appName);
  document.write("'<br>navigator.appVersion = '");
  document.write(navigator.appVersion);
  document.write("'<br>navigator.appCodeName = '");
  document.write(navigator.appCodeName);
  document.write("'<br>navigator.userAgent = '");
  document.write(navigator.userAgent);
  document.write("'");
  document.write(<br>navigator.javaEnabled() = ");
  document.write(
navigator.javaEnabled())

//-->
</script>

Return to HTML index
 


Current & Referring Page

Source Resulting Output
<script LANGUAGE="JavaScript">
 <!--
   document.write("Previous = '");
   document.write(document.referrer);
   document.write("'<br>Current = '");
   document.write(document.location);
   document.write("'");
 //-->
 </script>

Return to HTML index




Last Updated: $Date: 2006/03/22 21:08:26 $ GMT ($Revision: 2.13 $)