<!DOCTYPE HTML>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<script type="text/javascript">
var w=document.documentElement.offsetWidth;
var h=document.documentElement.offsetHeight;
document.write(w+"***"+h+"<br>");
document.write(document.body.offsetWidth+"<br>");
document.write(document.body.offsetHeight+"<br>");
var x = document.documentElement.offsetWidth || document.body.offsetWidth;
var y= document.documentElement.offsetHeight || document.body.offsetHeight;
document.write("宽度:" + x);
document.write("<br>高度:" + y);
</script>
</body>
</html>
浏览器的兼容性问题