473,405 Members | 2,415 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Getting size of window?

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
5 1099
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: dan glenn | last post by:
hi. I want to code a 'preview' function into a guestbook entry page. I can do it with a button that posts, bringing up a whole new page showing a preview of what has been entered, and then the user...
21
by: Michael Bierman | last post by:
Please forgive the simplicy of this question. I have the following code which attempts to determine the color of some text and set other text to match that color. It works fine in Firefox, but does...
4
by: BrianKE | last post by:
I am attempting to create an app that will run "on top" of another app. My app will create a transparent window over the other app for the purpose of displaying information. I am able to create...
2
by: jodleren | last post by:
Hi! I am making an option, which opens a small window with a picture in it and data about it. I just want a JS script, which will get the picture size, and then set the window accordingly? ...
7
vikas251074
by: vikas251074 | last post by:
I am getting error above in following code since few days giving tension day and night. How can I solve this? I am facing since Oct.25. in line no. 362 After doing a lot of homework, I am...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.