<html><head>
<title>Javascript-Beispiel</title>
<script LANGUAGE="JavaScript">
function display() {
window.onerror=null;
colors = window.screen.colorDepth;
document.form.color.value = Math.pow (2, colors);
if (window.screen.fontSmoothingEnabled == true)
document.form.fonts.value = "Yes";
else document.form.fonts.value = "No";
document.form.navigator.value
= navigator.appName;
document.form.version.value
= navigator.appVersion;
document.form.colordepth.value = window.screen.colorDepth;
document.form.width.value = window.screen.width;
document.form.height.value = window.screen.height;
document.form.maxwidth.value = window.screen.availWidth;
document.form.maxheight.value = window.screen.availHeight;
document.form.codename.value
= navigator.appCodeName;
document.form.platform.value = navigator.platform;
if (navigator.javaEnabled() < 1) document.form.java.value="No";
if (navigator.javaEnabled() == 1) document.form.java.value="Yes";
if(navigator.javaEnabled() && (navigator.appName != "Microsoft
Internet Explorer")) {
vartool=java.awt.Toolkit.getDefaultToolkit();
addr=java.net.InetAddress.getLocalHost();
host=addr.getHostName();
ip=addr.getHostAddress();
alert("Your host name is '" + host +
"'\nYour IP address is " + ip);
}
}
</script>
</head>
<body> <form name="form">
<p><input type="button" name="again"
value="Berechnung:" onclick="display()"></p>
<p>aktuelle Bildschirmauflösung: <input type="text" size="4"
maxlength="4" name="width">x
<input type="text" size="4" maxlength="4" name="height"></p>
<p>Größe des Desktops: <input type="text" size="4"
maxlength="4" name="maxwidth">
x <input type="text" size="4" maxlength="4" name="maxheight"></p>
<p>Farbtiefe: <input type="text" size="2"
maxlength="2" name="colordepth">
bit</p>
<p>Anzahl darstellbarer Farben: <input type="text" size="8"
maxlength="8" name="color"></p>
<p>anti-aliasing (geglättete) Fonts: <input type="text"
size="3" maxlength="3" name="fonts"></p>
<p>verwendeter Browser: <input type="text" size="30"
maxlength="20" name="navigator"></p>
<p>verwendete Version: <input type="text" size="30"
maxlength="20" name="version"></p>
<p>Code-Name des Browsers: <input type="text" size="15"
maxlength="15" name="codename"></p>
<p>Plattform (Betriebssystem): <input type="text" size="15"
maxlength="15" name="platform"></p>
<p>Java verfügbar? <input type="text" size="3"
maxlength="3" name="java"></p>
</form>
</body>
</html>