By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,654 Members | 1,582 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,654 IT Pros & Developers. It's quick & easy.

Getting size of window?

P: n/a
Hi,

What is the correct way to get the dimensions of the displayable window?
I.e. I don't want the border or the toolbar to be included in the height
or width.

I want to request an image from a php page by passing arguments for
height and width so that will be rendered to fit exactly in the window.

Thanks for any help.

Jun 27 '08 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Locke wrote:
What is the correct way to get the dimensions of the displayable window?
I.e. I don't want the border or the toolbar to be included in the height
or width.

I want to request an image from a php page by passing arguments for
height and width so that will be rendered to fit exactly in the window.

Thanks for any help.
http://www.jibbering.com/faq/#FAQ4_9

--
Bart
Jun 27 '08 #2

P: n/a
http://www.jibbering.com/faq/#FAQ4_9
>
Thanks, but none of those methods worked for me in IE 6.

The DOM method worked great in firefox and on my cell phone.

document.documentElement.clientHeight in firefox returns the height that
the content spans, not the height of the window :(

I need a solution that will work across all common browsers and
hopefully most cell phones. I assume at the moment this is not possible?

Thanks

Jun 27 '08 #3

P: n/a
Lee
On Jun 3, 2:05*pm, Locke <jlo...@www.comwrote:
*http://www.jibbering.com/faq/#FAQ4_9

Thanks, but none of those methods worked for me in IE 6.

The DOM method worked great in firefox and on my cell phone.

document.documentElement.clientHeight in firefox returns the height that
the content spans, not the height of the window :(

I need a solution that will work across all common browsers and
hopefully most cell phones. I assume at the moment this is not possible?

Thanks
document.body.clientHeight and document.body.clientWidth seems to work
fine on IE6, Firefox and Opera. Thats all I tested though.

Jun 27 '08 #4

P: n/a
Lee wrote:
On Jun 3, 2:05 pm, Locke <jlo...@www.comwrote:
>> http://www.jibbering.com/faq/#FAQ4_9
Thanks, but none of those methods worked for me in IE 6.

The DOM method worked great in firefox and on my cell phone.

document.documentElement.clientHeight in firefox returns the height that
the content spans, not the height of the window :(

I need a solution that will work across all common browsers and
hopefully most cell phones. I assume at the moment this is not possible?

Thanks

document.body.clientHeight and document.body.clientWidth seems to work
fine on IE6, Firefox and Opera. Thats all I tested though.
In firefox, the error console gives the following message:

Error: document.body has no properties
Source File: file:///.../dim2.html
Line: 4

Source:

<html>
<script>

var winWidth = document.body.clientWidth;
var winHeight = document.body.clientHeight;
document.write(winWidth + " x " + winHeight);

</script>
</html>

Jun 27 '08 #5

P: n/a
In firefox, the error console gives the following message:
>
Error: document.body has no properties
Source File: file:///.../dim2.html
Line: 4
Never mind, its because I didn't have a <bodysection, whoops!

Works now, thanks!

Jun 27 '08 #6

This discussion thread is closed

Replies have been disabled for this discussion.