Source Code
<html>
<head>
<script language="JavaScript">
function NNCheck(version) {
if((navigator.appName.indexOf('Netscape') >= 0)
&& (version <= parseInt(navigator.appVersion.substring(0, 3)))) {
return true;
} else {
return false;
}
}
function IECheck(version) {
if((navigator.appName.indexOf('Microsoft Internet Explorer') >= 0)
&& (version <= parseInt(navigator.appVersion.substring(22, 25)))) {
return true;
} else {
return false;
}
}
function MinorVerCheck() {
if(IECheck(4)) {
str = typeof(navigator.appMinorVersion);
if(str.indexOf("undefined") < 0) {
return true;
}
}
return false;
}
function PlatformCheck() {
if(NNCheck(4) || IECheck(4)) {
str = typeof(navigator.platform);
if(str.indexOf("undefined") < 0) {
return true;
}
}
return false;
}
function CPUClassCheck() {
if(IECheck(4)) {
str = typeof(navigator.cpuClass);
if(str.indexOf("undefined") < 0) {
return true;
}
}
return false;
}
function ScrSizeCheck() {
if(NNCheck(4) || IECheck(4)) {
str = typeof(screen.height);
if(str.indexOf("undefined") < 0) {
str = typeof(screen.width);
if(str.indexOf("undefined") < 0) {
return true;
}
}
}
return false;
}
function ColorBitCheck() {
if(NNCheck(4)) {
str = typeof(screen.pixelDepth);
if(str.indexOf("undefined") < 0) {
return true;
}
} else if(IECheck(4)) {
str = typeof(screen.colorDepth);
if(str.indexOf("undefined") < 0) {
return true;
}
}
return false;
}
</script>
</head>
<body>
<script language="JavaScript">
doc = "<p>Browser which you are using ";
if(NNCheck(2)) {
doc += "is <em>Netscape Navigator<\/em>.";
} else if(IECheck(3)) {
doc += "is <em>Microsoft Internet Explorer<\/em>.";
} else {
doc += "isn't defined.";
}
doc += "<\/p>";
document.write(doc);
doc = "<p>The version of browser which you are using ";
str = typeof(navigator.appVersion);
if(str.indexOf("undefined") < 0) {
doc += "is <em>" + navigator.appVersion + "<\/em>.";
} else {
doc += "isn't defined.";
}
doc += "<\/p>";
document.write(doc);
doc = "<p>The minor version of browser which you are using ";
if(MinorVerCheck()) {
doc += "is <em>" + navigator.appMinorVersion + "<\/em>.";
} else {
doc += "isn't defined.";
}
doc += "<\/p>";
document.write(doc);
doc = "<p>The platform which you are using ";
if(PlatformCheck()) {
doc += "is <em>" + navigator.platform + "<\/em>.";
} else {
doc += "isn't defined.";
}
doc += "<\/p>";
document.write(doc);
doc = "<p>The CPU class which you are using ";
if(CPUClassCheck()) {
doc += "is <em>"+navigator.cpuClass+"<\/em>.";
} else {
doc += "isn't defined.";
}
doc += "<\/p>";
document.write(doc);
doc = "<p>The size of the screen which you are using ";
if(ScrSizeCheck()) {
doc += "is <em>" + screen.width + " × " + screen.height + "<\/em>.";
} else {
doc += "isn't defined.";
}
doc += "<\/p>";
document.write(doc);
doc = "<p>The number of the indication bits of the screen which you are using ";
if(ColorBitCheck()) {
doc += "is <em>" + (NNCheck(4) ? screen.pixelDepth : screen.colorDepth) + " bits<\/em>. Indication color number is ";
str = "";
num1 = NNCheck(4) ? screen.pixelDepth : screen.colorDepth;
num2 = Math.pow(2, (num1 > 24 ? 24 : num1));
if(num2 >= 1000000) {
str = Math.floor(num2 / 1000000).toString() + ",";
}
if(num2 >= 1000) {
str += Math.floor((num2 % 1000000) / 1000).toString() + ",";
}
str += (num2 % 1000).toString();
doc += "<em>" + str + " colors<\/em>.";
} else {
doc += "isn't defined.";
}
doc += "<\/p>";
document.write(doc);
</script>
</body>
</html>