ページの横幅、縦幅を取得するには

<html>
<head>
<title>Sample</title>
</head>
<body>
ページの横幅と縦幅を求めます。<br>
<script type="text/javascript"><!--
if (document.all)
{
w = document.body.clientWidth;
h = document.body.clientHeight;
}else{
w = window.innerWidth;
h = window.innerHeight;
}
document.write("横幅:"+w+"ピクセル<br>");
document.write("縦幅:"+h+"ピクセル<br>");
// --></script>
</body>
</html>
・サンプルを実行
・サンプルをダウンロード
逆引きクイックリファレンス JavaScript 説明などは本書を参考にしてください。