Code:
if (parseInt(navigator.appVersion)>3) {
if (navigator.appName=="Netscape") {
winW = window.innerWidth;
winH = window.innerHeight;
}
if (navigator.appName.indexOf("Microsoft")!=-1) {
winW = document.body.offsetWidth;
winH = document.body.offsetHeight;
}
}
document.write(
"Window width = "+winW+"<br>"
+"Window height = "+winH
)
To adjust the width and height values taking into accout the scrollbars in Netscape Navigator: subtract 16 from the width and height and in Microsoft Internet Explorer: subtract 20 from the width and height
source