1.使用方法:
window.οnlοad=function(){
var width=document.documentElement.clientHeight;
var height=document.documentElement.clientWidth;
alert(width+"------"+height);
}
可能用这个方法在其他的浏览器屡试不爽,但是在火狐中就会出现height=0的情况.问其故,这是因为你没有在页面加入
W3C的标准
或
<!DOCTYPE html>
哎!!这就是兼容性啊!还是按照标准的好!!