第四段代碼的答案為什么是354*53
<script type="text/javascript">
var w=document.documentElement.clientWidth||document.body.clientWidth;
var h=document.documentElement.clientHeight||document.body.clientHeight;
document.write(w+"*"+h+"<br>")
var w=document.documentElement.clientWidth;
var h=document.documentElement.clientHeight;
document.write(w+"*"+h+"<br>")
var w=window.innerWidth;
var h=window.innerHeight;
document.write(w+"*"+h+"<br>")
var w=document.body.clientWidth;
var h=document.body.clientHeight;
document.write(w+"*"+h)
</script>
2017-02-08
body標(biāo)簽的內(nèi)部高寬是隨body中的內(nèi)容多少而定的;你輸出兩次document.body.clientHeight,其結(jié)果也不同,第二次會(huì)吧第一次輸出內(nèi)容的高度加上去重新計(jì)算高度
2016-10-22
在IE中
document.documentElement.clientHeight表示HTML文檔所在窗口的當(dāng)前高度。
?document.documentElement.clientWidth表示HTML文檔所在窗口的當(dāng)前寬度。
請(qǐng)注意是“當(dāng)前”高度與寬度?。。。?!