為什么明明是一樣的scrollHeight 輸出的高度卻不一樣呢?
<!DOCTYPE?HTML>
<html>
<head>
<meta?http-equiv="Content-Type"?content="text/html;?charset=utf-8">?
</head>
<body>
<script?type="text/javascript">
//法一
document.write("http:///******法一******///"+"<br?/>");
document.write(document.body.scrollWidth+"<br??/>");
document.write(document.body.scrollHeight);
//法二
var?w=document.documentElement.scrollWidth;
var?h=document.documentElement.scrollHeight;
document.write("<br>"+"http:///******法二******///"+"<br>"+"寬為:"+w+"<br>"+"高為:"+h);
var?a=document.documentElement.scrollWidth
???||?document.body.scrollWidth;
var?b=document.documentElement.scrollHeight
???||?document.body.scrollHeight;
document.write("<br>"+"http:///******法三******///"+"<br>"+"寬為:"+a+"<br>"+"高為:"+b);
</script>
</body>????
</html>運行結果:

2016-11-14
有些只識別document.body.scrollWidth;有些識別var document.documentelement.scrollWidth;
同一個瀏覽器 在絕大部分情況下 是一樣的
2016-12-28
瀏覽器兼容的問題吧!