JS获取HTML页面的BODY的高度

一个HTML页面并没有很长,不到一个浏览器全屏情况下的全部高度,怎么用JS获取HTML在<!DOCTYPE>下的完整高度,目前只能document.body.clientHeigh得到一部分。加上scrollHeight或者scrollTop也不到完整的浏览器的全屏高度,求解!
我要的是body的高度 你是屏幕的高度!!!晕

<html>
<head>

</head>
<body style="height:400px">
<div id="div1">12312</div>
<script type="text/javascript">

document.getElementById("div1").style.height=document.body.style.height;
alert(document.getElementById("div1").style.height);
//如果body,没有设置样式,这个高度就为空
document.getElementById("div1").style.height=document.body.clientHeight
alert(document.getElementById("div1").style.height);
//如果设置了样式,offsetHeight就等于样式的height否则等于clientHeight
document.getElementById("div1").style.height=document.body.offsetHeight
alert(document.getElementById("div1").style.height);
</script>
</body>
</html>
温馨提示:答案为网友推荐,仅供参考
第1个回答  2010-08-21
http://www.360doc.com/content/10/0813/18/2197500_45814588.shtml
这个比较全,你看一下。本回答被提问者采纳
第2个回答  2010-08-31
function getTotalHeight(){
if ($.browser.msie)
return document.compatMode == "CSS1Compat" ? document.documentElement.clientHeight : document.body.clientHeight;
else
return self.innerHeight;
}
第3个回答  2010-08-21
window.screen.height
看对不对
第4个回答  2010-08-27
document.body.scrollHeight