window properties from java script....

  • Thread starter Thread starter Brown Smith
  • Start date Start date
B

Brown Smith

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
 
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
 
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
 
Back
Top