It says object expected when I try to alert(document.body.client
Main Topics
Browse All TopicsThe title basically sums it up in a nutshell, I need to find a way to get the width and height of the window minus the toolbars and scrollbars. In firefox I can achieve this with:
window.innerWidth
window.innerHeight
IE does not support this, and I've yet to find some other way to do this.
TIA
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
You need three sets of code, one for Netscape, one for Explorer 6 if you use a DOCTYPE, and one for Explorer in all other cases:
if (self.innerWidth) {
frameWidth = self.innerWidth;
frameHeight = self.innerHeight;
}
else if (document.documentElement && document.documentElement.c
frameWidth = document.documentElement.c
frameHeight = document.documentElement.c
}
else if (document.body) {
frameWidth = document.body.clientWidth;
frameHeight = document.body.clientHeight
}
Business Accounts
Answer for Membership
by: x4uPosted on 2006-04-15 at 13:35:37ID: 16461704
In IE you can use document.body.clientHeight or document.documentElement.c lientHeigh t for standard mode (non quirks). But these will only work after the body was loaded, i.e. you can access them inside a OnLoad handler.