473,656 Members | 2,762 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1154
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********@hot mail.com> wrote in message
news:eH******** ******@tk2msftn gp13.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.innerWi dth == null) {
// microsoft version
var width = document.docume ntElement.offse tWidth;
var height = document.docume ntElement.offse tHeight; }
else {
// netscape version
var width = window.innerWid th;
var height = window.innerHei ght; }

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

Bart

"Brown Smith" <BB********@hot mail.com> wrote in message
news:eH******** ******@tk2msftn gp13.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
1641
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 add the values to be preserved for after refresh.
4
7581
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 keywords, didn't find the solution. It seems to be as easy as it gets: open a new window with a new url. in IE (I am using IE in mac osx), the error message is: Microsoft JScript runtime error: Line: 9
3
3024
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 - also allow them? Adding (and removing) object properties dynamically is an acceptable and common practice in JavaScript, and greatly adds to the power and character of the language. Essentially, an object in JavaScript can be considered to...
3
5627
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
386
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 (VS 2003) ASP.NET Web appl. with Java Script setting in design properties. I created a simple app with one button, under this button I have tried: just to test the command Page.RegisterStartupScript I tried: Page.RegisterStartupScript("TEST",...
26
5664
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 several parts of the DOM, but this does not include the window object. Thank you
7
2508
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 below, both the main and child disappears(this is due to pop up blocker) disappears suddenly. I want to make the browser know if pop up blocks the child window(in case). help me how to check the child window opened successfuly or not, on
11
2218
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 onloadListeners, addOnLoadListener below window?
24
8203
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 seems to have a (tiny) amount overhead since window itself points to the global object, hence, a circular reference. (From everything I am reading, window is just a REFERENCE back to the global object, as opposed to a separate object.)
0
8297
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8816
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8717
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8600
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7311
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6162
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5629
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1930
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.