例1:
<Script>
with (document) {
write ("您的屏幕显示设定值如下:<P>");
write ("屏幕的实际高度为", screen.availHeight, "<BR>");
write ("屏幕的实际宽度为", screen.availWidth, "<BR>");
write ("屏幕的色盘深度为", screen.colorDepth, "<BR>");
write ("屏幕区域的高度为", screen.height, "<BR>");
write ("屏幕区域的宽度为", screen.width);
}
</Script>
例2:
<Script>
if ( screen.width < 800 || screen.colorDepth < 8 ){
var msg = "本网站最佳浏览模式为 800 * 600 * 256";
alert(msg);
}
</Script>