//这是一段测试浏览器支持的宽高的实例,可以用不同的浏览器去打开看效果
var keys={
"document.body.clientWidth":"网页可见区域宽",
"document.body.clientHeight":"网页可见区域高",
"document.documentElement.clientWidth":"网页可见区域宽",
"document.documentElement.clientHeight":"网页可见区域高",
"document.body.offsetWidth":"网页可见区域宽",
"document.body.offsetHeight":"网页可见区域高",
"document.body.scrollHeight":"网页正文全文宽",
"document.body.scrollWidth":"网页正文全文高",
"document.body.scrollTop":"网页被卷去的高",
"document.body.scrollLeft":"网页被卷去的左",
"window.screenTop":"网页正文部分上",
"window.screenLeft":"网页正文部分左",
"window.screen.height":"屏幕分辨率的高",
"window.screen.width":"屏幕分辨率的宽",
"window.screen.availHeight":"屏幕可用工作区高",
"window.screen.availWidth":"屏幕可用工作区宽"
};
var str="";
for(i in keys){
try{
str+=keys[i]+i+":"+window.eval(i)+"\n";
}catch(e){
}
}
alert(str);