window properties from java script....

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
 
B

Brown 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
 
B

Bart

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top