暂时总结的判断方法如下: var h1 = document.body.clientHeight; var h2 = document.documentElement.clientHeight; var isXhtml = (h2<=h1&&h2!=0)?true:false; //判断当前页面的Doctype是否为Xhtml var body = isXhtml?document.documentElement:document.body; alert(body.clientHeight); //最终结果比较一致