<script language="javascript" type="text/javascript">
function onload(){
var width = 0;
var height = 0;
if(navigator.userAgent.indexOf("Firefox")>0) {//是否是火狐.
height = document.body.scrollHeight;
} else {
height = document.documentElement.scrollHeight;
}
alert(height:" + height);
}
onload();
</script>
最后使用jquery:
$(window).height(); //一行代码搞定.
jquery常用:
http://www.wufangbo.com/jquery-tips/