473,386 Members | 1,798 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,386 software developers and data experts.

window properties from java script....

How to get the browser window properties at run time through java script
code?

When my ASP.Net application is launched (through IE only) I am interested
with the following properties from client side code.

Where exactly the browser is located on the screen. Interested in left and
top properties. And the height and width of the browsing instance window.

I am trying to set the same height and width and location when the user
launches the my application next time.

Thanks,

Smith
Nov 19 '05 #1
2 1146
I am trying to read document.width and document.height.
When I try to read the above values it says undefined.
Why?
I am using IE5.5+
Thanks,
Smith
"Brown Smith" <BB********@hotmail.com> wrote in message
news:eH**************@tk2msftngp13.phx.gbl...
How to get the browser window properties at run time through java script
code?

When my ASP.Net application is launched (through IE only) I am interested
with the following properties from client side code.

Where exactly the browser is located on the screen. Interested in left and
top properties. And the height and width of the browsing instance window.

I am trying to set the same height and width and location when the user
launches the my application next time.

Thanks,

Smith

Nov 19 '05 #2
This snippet always works for me:

if (window.innerWidth == null) {
// microsoft version
var width = document.documentElement.offsetWidth;
var height = document.documentElement.offsetHeight; }
else {
// netscape version
var width = window.innerWidth;
var height = window.innerHeight; }

Not sure if it's possible to determine the position of the browser window
though.

Bart

"Brown Smith" <BB********@hotmail.com> wrote in message
news:eH**************@tk2msftngp13.phx.gbl...
How to get the browser window properties at run time through java script
code?

When my ASP.Net application is launched (through IE only) I am interested
with the following properties from client side code.

Where exactly the browser is located on the screen. Interested in left and
top properties. And the height and width of the browsing instance window.

I am trying to set the same height and width and location when the user
launches the my application next time.

Thanks,

Smith

Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Tom Szabo | last post by:
Hi, In order to preserve some settings and avoid cookies I have thought of the following trick: I simply create an array as the property of the window: window.aList = new Array(); and...
4
by: Anna Quick | last post by:
I am quite new to javascript, and don't seem to find the problem with stupid internet explorer. The script works fine in safari and mozilla. I searched the groups, but evidently put in the wrong...
3
by: ytrewq | last post by:
Should dynamic ("expando") properties be restricted to native and user-defined objects? Or should host objects - such as references to the browser or a plug-in or to the document and its elements -...
3
by: anonieko | last post by:
You can try this code: > > > > > <!--- filename: mypage.html ----> <html> ....blah blah blah <script language=JavaScript src=/Javascript/center.js></script>
1
by: bucrepus | last post by:
I know response.redirect doesn't open a new page. I have read many posts on how to fix this but I can't get the first one to work. Please help.. I have tried on 2 diff dev machines with no success...
26
by: yb | last post by:
Hi, Is there a standard for the global 'window' object in browsers? For example, it supports methods such as setInterval and clearInterval, and several others. I know that w3c standardized...
7
by: Jaggu | last post by:
Hi , I need to close main window, once the child window succesfully opens else main window to remain. In my case when I close the main window immediately after the "window.open()" as mentioned...
11
by: gg9h0st | last post by:
i saw a code refactorying onload event listener window.onloadListeners=new Array(); window.addOnLoadListener=function(listener) { window.onloadListeners=listener; } why declare the...
24
by: Jeremy J Starcher | last post by:
While reading c.l.j, I've noticed that some people prefer and indeed even recommend the use of "window.alert()" over "alert()". I can't find any technical reason to make this distinction, and...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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,...

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.