小迷糊求指导~~~
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<script type="text/javascript">
/* var height1 =document.documentElemnet.clientHeight||document.body.clientHeight;
var width1 =document.documentElement.clientWidth||document.body.clientWidth;
document.write(height1 + "<br/>");
document.write(width1 + "<br/>");*/
var height2 = document.body.clientHeight;
var width2 = document.body.clientWidth;
document.write(height2+"<br/>");
document.write(width2+"<br/>");
var height3 = window.innerHeight;
var width3 = window.innerWidth;
document.write(height3+"<br/>");
document.write(width3+"<br/>");
var height4 = document.documentElement.clientHeight;
var width4 = document.documentElement.clientWidth;
document.write(height4+"<br/>");
document.write(width4+"<br/>");
</script>
</body>
</html>
1.上述代码 为什么我把求width1和height1的内容加上就不显示输出结果。
只求得下面三个就可以?
2.window.innerHeight与 document.documentElement.clientHeight和document.body.clientHeight的结果不同?
究竟这三个有什么区别与不同,分别怎么应用?